File tree Expand file tree Collapse file tree 4 files changed +8
-2
lines changed
Expand file tree Collapse file tree 4 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ First make sure maven is properly installed
55command :
66mvn clean package appassembler: assemble -Dmaven.test.skip=true -X
77
8+ ipfs pubsub peers bmJzaW8ubmV0
89# Version History
910## Version 2.0.1
1011 - 聊天功能
Original file line number Diff line number Diff line change 99import io .nbs .client .ui .panels .im .ChatPanel ;
1010import io .nbs .commons .helper .ConfigurationHelper ;
1111
12+ import io .nbs .commons .utils .UUIDGenerator ;
1213import io .nbs .sdk .beans .*;
1314import io .nbs .sdk .prot .IPMParser ;
1415import io .nbs .sdk .prot .IPMTypes ;
@@ -121,13 +122,14 @@ private void proccessMessage(List<String> jsonMessages){
121122 logger .warn ("消息JSON :{}解析失败,忽略." ,json );
122123 continue ;
123124 }
124- if (standardIPFSMessage .getMtype ().equals (IPMTypes .nomarl .name ())){
125+ if (standardIPFSMessage .getMtype ().equals (IPMTypes .nomarl .name ())
126+ || standardIPFSMessage .getMtype ().equals (IPMTypes .unkonw )){
125127 if (subscribeListener ==null )continue ;
126128 MessageItem item = IPMParser .convertMessageItem (standardIPFSMessage );
127129 item .setMessageType (1 );
128130 PeerInfo info =Launcher .currentPeer ;
129131 logger .info ("{}<=====>{}" ,info .getId (),item .getFrom ());
130-
132+ item . setId ( UUIDGenerator . getUUID ());
131133 subscribeListener .notifyRecvMessage (item );
132134 }
133135 if (standardIPFSMessage .getMtype ().equals (IPMTypes .online .name ())){
Original file line number Diff line number Diff line change 33import com .alibaba .fastjson .JSON ;
44import io .ipfs .api .exceptions .IllegalIPFSMessageException ;
55import io .nbs .commons .utils .Base64CodecUtil ;
6+ import io .nbs .commons .utils .UUIDGenerator ;
67import io .nbs .sdk .beans .*;
78import org .apache .commons .lang3 .StringUtils ;
89import org .springframework .util .Base64Utils ;
@@ -141,6 +142,7 @@ public static StandardIPFSMessage decodeStandardIPFSMessage(String json) throws
141142 public static IMMessageBean convertIMMessageBean (StandardIPFSMessage message ){
142143
143144 IMMessageBean bean = new IMMessageBean ();
145+
144146 bean .setFrom (message .getFrom ());
145147 bean .setSeqno (message .getSeqno ());
146148 bean .setMtype (message .getMtype ());
@@ -157,6 +159,7 @@ public static IMMessageBean convertIMMessageBean(StandardIPFSMessage message){
157159 */
158160 public static MessageItem convertMessageItem (StandardIPFSMessage message ){
159161 MessageItem bean = new MessageItem ();
162+ bean .setId (UUIDGenerator .getUUID ());
160163 bean .setNeedToResend (false );
161164 bean .setTimestamp (System .currentTimeMillis ());
162165 bean .setFrom (message .getFrom ());
You can’t perform that action at this time.
0 commit comments