44import android .app .PendingIntent ;
55import android .content .Intent ;
66import android .support .v4 .app .NotificationCompat ;
7+ import android .text .TextUtils ;
78
89import com .netease .im .IMApplication ;
910import com .netease .im .session .extension .RedPacketOpenAttachement ;
@@ -114,7 +115,7 @@ public static void receiver(NotificationManager manager, CustomNotification cust
114115 try {
115116 t = Long .parseLong (timestamp );
116117 } catch (NumberFormatException e ) {
117- t = System .currentTimeMillis ()/ 1000 ;
118+ t = System .currentTimeMillis () / 1000 ;
118119 e .printStackTrace ();
119120 }
120121// LogUtil.i("timestamp","timestamp:"+timestamp);
@@ -168,6 +169,9 @@ public static void sendRedPacketOpenLocal(String sessionId, SessionTypeEnum sess
168169 public static void sendRedPacketOpenNotification (String sessionId , SessionTypeEnum sessionType ,
169170 String sendId , String openId , String hasRedPacket , String serialNo , long timestamp ) {
170171
172+ if (TextUtils .equals (sendId , openId )) {
173+ return ;
174+ }
171175 Map <String , Object > data = new HashMap <>();
172176 Map <String , String > dict = new HashMap <>();
173177 dict .put ("sendId" , sendId );
@@ -182,7 +186,7 @@ public static void sendRedPacketOpenNotification(String sessionId, SessionTypeEn
182186
183187 CustomNotification notification = new CustomNotification ();
184188 notification .setSessionId (sendId );
185- notification .setSessionType (sessionType );
189+ notification .setSessionType (SessionTypeEnum . P2P );
186190 CustomNotificationConfig config = new CustomNotificationConfig ();
187191 config .enablePush = false ;
188192 config .enableUnreadCount = false ;
0 commit comments