Skip to content

Commit e88ff66

Browse files
authored
Merge pull request #5 from jpush/dev
Dev
2 parents 9c02af1 + e933a07 commit e88ff66

File tree

7 files changed

+13
-429
lines changed

7 files changed

+13
-429
lines changed

android/jmessage-react-plugin.iml

Lines changed: 0 additions & 142 deletions
This file was deleted.

android/src/io/jchat/android/entity/MyConversation.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
public class MyConversation {
55

6+
private String id;
67
private String title;
78
private String username;
89
private String groupId;
@@ -12,8 +13,9 @@ public class MyConversation {
1213
private String lastMsg;
1314
private String appKey;
1415

15-
public MyConversation(String title, String username, String groupId, String avatarPath,
16+
public MyConversation(String id, String title, String username, String groupId, String avatarPath,
1617
int unreadMsgCnt, long date, String lastMsg, String appKey) {
18+
this.id = id;
1719
this.title = title;
1820
this.username = username;
1921
this.groupId = groupId;

android/src/io/jchat/android/tools/ConversationToJSON.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,12 @@ public ConversationToJSON(Context context, Conversation conv) {
8181
lastMsg = context.getString(R.string.type_custom);
8282
}
8383
break;
84-
default:
84+
case text:
8585
lastMsg = ((TextContent) message.getContent()).getText();
86+
break;
8687
}
8788
}
88-
myConversation = new MyConversation(title, username, groupId, avatar, unreadMsgCnt,
89+
myConversation = new MyConversation(conv.getId(), title, username, groupId, avatar, unreadMsgCnt,
8990
date, lastMsg, conv.getTargetAppKey());
9091
Gson gson = new Gson();
9192
mResult = gson.toJson(myConversation);
@@ -140,13 +141,15 @@ public ConversationToJSON(Context context, List<Conversation> data) {
140141
lastMsg = context.getString(R.string.type_custom);
141142
}
142143
break;
143-
default:
144+
case text:
144145
lastMsg = ((TextContent) message.getContent()).getText();
146+
break;
145147
}
146148
}
147-
myConversation = new MyConversation(title, username, groupId, avatar, unreadMsgCnt,
149+
myConversation = new MyConversation(conv.getId(), title, username, groupId, avatar, unreadMsgCnt,
148150
date, lastMsg, conv.getTargetAppKey());
149151
list.add(myConversation);
152+
lastMsg = "";
150153
}
151154
Gson gson = new Gson();
152155
mResult = gson.toJson(list);

0 commit comments

Comments
 (0)