Skip to content

Commit 94a0497

Browse files
authored
Merge pull request #127 from JoshLipan/dev
Dev
2 parents 198218f + 8ce0bf5 commit 94a0497

File tree

5 files changed

+18
-10
lines changed

5 files changed

+18
-10
lines changed

android/build.gradle

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
apply plugin: 'com.android.library'
22

3+
def safeExtGet(prop, fallback) {
4+
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
5+
}
6+
37
android {
4-
compileSdkVersion 23
5-
buildToolsVersion "25.0.2"
8+
compileSdkVersion safeExtGet('compileSdkVersion', 27)
9+
buildToolsVersion safeExtGet('buildToolsVersion', '26.0.2')
610

711
defaultConfig {
8-
minSdkVersion 16
9-
targetSdkVersion 22
12+
minSdkVersion safeExtGet('minSdkVersion', 16)
13+
targetSdkVersion safeExtGet('targetSdkVersion', 27)
1014
versionCode 1
1115
versionName "1.0"
1216
}
@@ -31,6 +35,6 @@ repositories {
3135
}
3236

3337
dependencies {
34-
compile fileTree(dir: 'libs', include: ['*.jar'])
35-
compile "com.facebook.react:react-native:+"
38+
api fileTree(include: ['*.jar'], dir: 'libs')
39+
implementation 'com.facebook.react:react-native:+'
3640
}

android/src/io/jchat/android/JMessageModule.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1870,7 +1870,7 @@ public void processApplyJoinGroup(final ReadableMap map, final Callback success,
18701870
List<GroupApprovalEvent> groupApprovalEventList = new ArrayList<>();
18711871

18721872
for (int i = 0; i < array.size(); i++) {
1873-
GroupApprovalEvent groupApprovalEvent = groupApprovalEventHashMap.get(array.getString(i));
1873+
GroupApprovalEvent groupApprovalEvent = groupApprovalEventHashMap.remove(array.getString(i));
18741874
if (groupApprovalEvent == null) {
18751875
mJMessageUtils.handleError(fail, ERR_CODE_PARAMETER,
18761876
ERR_MSG_PARAMETER + ": can't get event through " + array.getString(i));
@@ -2065,7 +2065,9 @@ public void onEventMainThread(ChatRoomMessageEvent event) {
20652065

20662066
public void onEvent(GroupApprovalEvent event) {
20672067
Log.d(TAG, "GroupApprovalEvent, event: " + event);
2068-
groupApprovalEventHashMap.put(event.getEventId() + "", event);
2068+
GroupApprovalEvent save_event = new GroupApprovalEvent();
2069+
save_event = event;
2070+
groupApprovalEventHashMap.put(event.getEventId() + "", save_event);
20692071
GroupApprovalEvent.Type type = event.getType();
20702072
final WritableMap map = Arguments.createMap();
20712073
map.putString(Constant.EVENT_ID, event.getEventId() + "");

example/android/app/src/main/java/com/sample/application/MainApplication.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
import com.facebook.react.ReactApplication;
77
import com.rnfs.RNFSPackage;
8+
9+
import cn.jiguang.imui.messagelist.BuildConfig;
810
import io.jchat.android.JMessageReactPackage;
911

1012
import cn.jiguang.imui.messagelist.ReactIMUIPackage;

example/app/routes/Chat/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ export default class Chat extends Component {
325325
eventMsg.msgId = message.msgId
326326
eventMsg.msgType = "event"
327327
eventMsg.text = "撤回的消息"
328-
AuroraIController.updateMessage(message)
328+
AuroraIController.updateMessage(eventMsg);
329329
}, (error) => {
330330

331331
})

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jmessage-react-plugin",
3-
"version": "2.4.8",
3+
"version": "2.5.0",
44
"description": "a jmessage plugin for react native application",
55
"main": "index.js",
66
"repository": {

0 commit comments

Comments
 (0)