23 import com.beem.project.beem.R; |
23 import com.beem.project.beem.R; |
24 import com.beem.project.beem.service.aidl.IChat; |
24 import com.beem.project.beem.service.aidl.IChat; |
25 import com.beem.project.beem.service.aidl.IChatManager; |
25 import com.beem.project.beem.service.aidl.IChatManager; |
26 import com.beem.project.beem.service.aidl.IChatManagerListener; |
26 import com.beem.project.beem.service.aidl.IChatManagerListener; |
27 import com.beem.project.beem.service.aidl.IMessageListener; |
27 import com.beem.project.beem.service.aidl.IMessageListener; |
28 import com.beem.project.beem.ui.SendIM; |
|
29 |
28 |
30 /** |
29 /** |
31 * An adapter for smack's ChatManager. This class provides functionnality to handle chats. |
30 * An adapter for smack's ChatManager. This class provides functionnality to handle chats. |
32 * @author darisk |
31 * @author darisk |
33 */ |
32 */ |
76 String text = chat.getParticipant().getJID(); |
75 String text = chat.getParticipant().getJID(); |
77 Notification notif = new Notification(android.R.drawable.stat_notify_chat, text, System |
76 Notification notif = new Notification(android.R.drawable.stat_notify_chat, text, System |
78 .currentTimeMillis()); |
77 .currentTimeMillis()); |
79 notif.defaults = Notification.DEFAULT_ALL; |
78 notif.defaults = Notification.DEFAULT_ALL; |
80 notif.flags = Notification.FLAG_AUTO_CANCEL; |
79 notif.flags = Notification.FLAG_AUTO_CANCEL; |
81 Intent intent = new Intent(mService, SendIM.class); |
80 Intent intent = new Intent(mService, Chat.class); |
82 intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT | Intent.FLAG_ACTIVITY_SINGLE_TOP); |
81 intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT | Intent.FLAG_ACTIVITY_SINGLE_TOP); |
83 intent.setData(chat.getParticipant().toUri()); |
82 intent.setData(chat.getParticipant().toUri()); |
84 notif.setLatestEventInfo(mService, text, mService.getString(R.string.BeemChatManagerNewMessage), |
83 notif.setLatestEventInfo(mService, text, mService.getString(R.string.BeemChatManagerNewMessage), |
85 PendingIntent.getActivity(mService, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT)); |
84 PendingIntent.getActivity(mService, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT)); |
86 int id = chat.hashCode(); |
85 int id = chat.hashCode(); |