Beispiel #1
0
  private void showNotification(ECMessage ecMessage) {
    CallUpNotificationManager.getInstance().forceCancelNotification();

    int userId = Integer.parseInt(ecMessage.getForm());
    Friend friend = FriendCache.getInstance(mContext).getFriend(userId);
    if (friend == null) {
      return;
    }

    CallUpNotificationManager.getInstance()
        .showCustomNewMessageNotification(
            BaseInfoUtil.getContext(),
            friend,
            ecMessage.getSessionId(),
            ecMessage.getType().ordinal());
  }
Beispiel #2
0
 private static void showNotification(ECMessage msg) {
   if (checkNeedNotification(msg.getSessionId())) {
     ECNotificationManager.getInstance().forceCancelNotification();
     String lastMsg = "";
     if (msg.getType() == ECMessage.Type.TXT) {
       lastMsg = ((ECTextMessageBody) msg.getBody()).getMessage();
     }
     ECContacts contact = ContactSqlManager.getContact(msg.getForm());
     if (contact == null) {
       return;
     }
     ECNotificationManager.getInstance()
         .showCustomNewMessageNotification(
             CCPAppManager.getContext(),
             lastMsg,
             contact.getNickname(),
             msg.getSessionId(),
             msg.getType().ordinal());
   }
 }