Retrait des notifications quand on ouvre le chat d'une personne qui vient
d'envoyer un message
fixes #174
--- a/src/com/beem/project/beem/BeemService.java Sun Sep 27 20:16:58 2009 +0200
+++ b/src/com/beem/project/beem/BeemService.java Wed Sep 30 00:15:45 2009 +0200
@@ -174,6 +174,14 @@
}
/**
+ * Delete a notification
+ * @param id the id of the notification
+ */
+ public void deleteNotification(int id) {
+ mNotificationManager.cancel(id);
+ }
+
+ /**
* Reset the status to online after a deconnection.
*/
public void resetStatus() {
--- a/src/com/beem/project/beem/service/BeemChatManager.java Sun Sep 27 20:16:58 2009 +0200
+++ b/src/com/beem/project/beem/service/BeemChatManager.java Wed Sep 30 00:15:45 2009 +0200
@@ -226,6 +226,11 @@
Log.w(TAG, "CA devrait pas 1!!" + chat.getParticipant().getJID());
}
+ @Override
+ public void deleteChatNotification(IChat chat) {
+ mService.deleteNotification(chat.hashCode());
+ }
+
/**
* Get an existing ChatAdapter or create it if necessary.
*
--- a/src/com/beem/project/beem/service/aidl/IChatManager.aidl Sun Sep 27 20:16:58 2009 +0200
+++ b/src/com/beem/project/beem/service/aidl/IChatManager.aidl Wed Sep 30 00:15:45 2009 +0200
@@ -27,6 +27,11 @@
*/
void destroyChat(in IChat chat);
+ /**
+ * @param chat the chat
+ */
+ void deleteChatNotification(in IChat chat);
+
/**
* Register a callback to call when a new chat session is created.
* @param listener the callback to add
@@ -38,4 +43,4 @@
* @param listener the callback to remove.
*/
void removeChatCreationListener(in IChatManagerListener listener);
-}
\ No newline at end of file
+}
--- a/src/com/beem/project/beem/ui/SendIM.java Sun Sep 27 20:16:58 2009 +0200
+++ b/src/com/beem/project/beem/ui/SendIM.java Wed Sep 30 00:15:45 2009 +0200
@@ -28,6 +28,7 @@
import android.widget.ImageView;
import android.widget.ScrollView;
import android.widget.TextView;
+import android.app.NotificationManager;
import com.beem.project.beem.BeemService;
import com.beem.project.beem.R;
@@ -384,6 +385,7 @@
mChat = mChatManager.createChat(newContact, mMessageListener);
showMessageList(mChat.getMessages());
mChat.setOpen(true);
+ mChatManager.deleteChatNotification(mChat);
mContact = newContact;
mToSend.requestFocus();
}