--- a/src/com/beem/project/beem/service/BeemChatManager.java Wed Dec 29 13:04:38 2010 +0100
+++ b/src/com/beem/project/beem/service/BeemChatManager.java Wed Dec 29 13:14:49 2010 +0100
@@ -40,7 +40,7 @@
Flavien Astraud, November 26, 2009
Head of the EIP Laboratory.
- */
+*/
package com.beem.project.beem.service;
import java.util.ArrayList;
@@ -79,7 +79,8 @@
private final ChatManager mAdaptee;
private final Map<String, ChatAdapter> mChats = new HashMap<String, ChatAdapter>();
private final ChatListener mChatListener = new ChatListener();
- private final RemoteCallbackList<IChatManagerListener> mRemoteChatCreationListeners = new RemoteCallbackList<IChatManagerListener>();
+ private final RemoteCallbackList<IChatManagerListener> mRemoteChatCreationListeners =
+ new RemoteCallbackList<IChatManagerListener>();
private final BeemService mService;
/**
--- a/src/com/beem/project/beem/service/ChatAdapter.java Wed Dec 29 13:04:38 2010 +0100
+++ b/src/com/beem/project/beem/service/ChatAdapter.java Wed Dec 29 13:14:49 2010 +0100
@@ -40,7 +40,7 @@
Flavien Astraud, November 26, 2009
Head of the EIP Laboratory.
- */
+*/
package com.beem.project.beem.service;
import java.io.File;
@@ -202,59 +202,70 @@
mMessages.remove(0);
mMessages.add(msg);
if (!"".equals(msg.getBody()) && msg.getBody() != null) {
- saveHistory(msg, msg.getFrom());
+ saveHistory(msg, msg.getFrom());
}
}
/**
- * Save message in SDCard
+ * Save message in SDCard.
* @param msg the message receive
- */
+ * @param contactName the name of the contact
+ */
public void saveHistory(Message msg, String contactName) {
String state = Environment.getExternalStorageState();
if (mIsHisory && Environment.MEDIA_MOUNTED.equals(state)) {
- File path = new File(Environment.getExternalStorageDirectory(), "beem");
- File filepath;
- if (msg.getFrom() == contactName)
- filepath = new File(path, StringUtils.parseBareAddress(contactName));
- else
- filepath = new File(path,StringUtils.parseBareAddress(msg.getTo()));
+ File path = new File(Environment.getExternalStorageDirectory(), "beem");
+ File filepath;
+ if (msg.getFrom() == contactName)
+ filepath = new File(path, StringUtils.parseBareAddress(contactName));
+ else
+ filepath = new File(path, StringUtils.parseBareAddress(msg.getTo()));
path.mkdirs();
try {
FileWriter file = new FileWriter(filepath, true);
- String log = msg.getTimestamp() + " " + contactName + " " + msg.getBody() + System.getProperty("line.separator");
- file.write(log);
- file.close();
- Log.i(TAG, log);
- } catch(IOException e) {
+ String log = msg.getTimestamp() + " " + contactName + " " + msg.getBody() +
+ System.getProperty("line.separator");
+ file.write(log);
+ file.close();
+ Log.i(TAG, log);
+ } catch (IOException e) {
e.printStackTrace();
}
}
}
/**
- * set History state
- * @param mIsHisory
+ * set History state.
+ * @param mIsHisory history state
*/
public void setHisory(boolean isHisory) {
this.mIsHisory = isHisory;
}
/**
- * get History state
- * @return
+ * get History state.
+ * @return mIsHistory
*/
public boolean getHisory() {
return mIsHisory;
}
+ /**
+ * Set Account user name.
+ * @param accountUser user name
+ */
public void setAccountUser(String accountUser) {
mAccountUser = accountUser;
}
-
+
+ /**
+ * get Account user name.
+ * @return mAccountUser
+ */
public String getAccountUser() {
return mAccountUser;
}
+
/**
* Listener.
*/
--- a/src/com/beem/project/beem/ui/Chat.java Wed Dec 29 13:04:38 2010 +0100
+++ b/src/com/beem/project/beem/ui/Chat.java Wed Dec 29 13:14:49 2010 +0100
@@ -40,7 +40,7 @@
Flavien Astraud, November 26, 2009
Head of the EIP Laboratory.
- */
+*/
package com.beem.project.beem.ui;
import java.text.DateFormat;
--- a/src/com/beem/project/beem/ui/Settings.java Wed Dec 29 13:04:38 2010 +0100
+++ b/src/com/beem/project/beem/ui/Settings.java Wed Dec 29 13:14:49 2010 +0100
@@ -40,7 +40,7 @@
Flavien Astraud, November 26, 2009
Head of the EIP Laboratory.
- */
+*/
package com.beem.project.beem.ui;
import android.content.ComponentName;