Skip to content

Commit 7fecb0b

Browse files
KenChoiKenChoi
authored andcommitted
merge conflict
2 parents 8c3f03c + c81507e commit 7fecb0b

File tree

4 files changed

+26
-8
lines changed

4 files changed

+26
-8
lines changed

example/app/routes/FriendInfo/index.js

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,23 +48,36 @@ const {
4848
export default class MyNotificationsScreen extends React.Component {
4949
static navigationOptions = {
5050
title: "好友详情",
51+
avatarPath: "",
5152
};
5253
constructor(props) {
5354
super(props)
5455
this.state = {
5556
userInfo: this.props.navigation.state.params.user
56-
}
57+
}
58+
59+
// JMessage.downloadOriginalUserAvatar({'username': this.state.userInfo.username}, (result) => {
60+
// this.setState({avatarPath: result.filePath})
61+
// }, (eror) => {
62+
// Alert.alert('error',JSON.stringify(error))
63+
// })
64+
65+
JMessage.downloadThumbUserAvatar({'username': this.state.userInfo.username}, (result) => {
66+
this.setState({avatarPath: result.filePath})
67+
}, (eror) => {
68+
Alert.alert('error',JSON.stringify(error))
69+
})
5770
}
5871

5972
render() {
60-
if (this.state.userInfo.avatarThumbPath === "") {
73+
if (this.state.avatarPath === "") {
6174
this.avatar = <Image
6275
source={require('../../resource/group-icon.png')}
6376
style={styles.avatar}>
6477
</Image>
6578
} else {
6679
this.avatar = <Image
67-
source={{isStatic:true,uri:this.state.userInfo.avatarThumbPath, scale:1}}
80+
source={{isStatic:true,uri:this.state.avatarPath, scale:1}}
6881
style={styles.avatar}>
6982
</Image>
7083
}

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ const syncRoamingMessage = "JMessage.SyncRoamingMessage" // 同步漫游消息
1515
const messageRetract = "JMessage.MessageRetract" // 消息撤回事件
1616
const contactNotify = "JMessage.ContactNotify" // 收到好友请求消息事件
1717
const uploadProgress = "JMessage.UploadProgress" // 收到好友请求消息事件
18+
const conversationChange = "JMessage.conversationChange" // 会话变更事件
1819

1920
export default class JMessage {
2021

@@ -897,5 +898,4 @@ export default class JMessage {
897898
listeners[listener].remove();
898899
listeners[listener] = null;
899900
}
900-
901901
}

ios/RCTJMessageModule/RCTJMessageModule.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919

2020
#define receiveMsgEvent @"JMessage.ReceiveMsgEvent" // 接收到消息事件
21+
#define conversationChangeEvent @"JMessage.conversationChange" // 会话变更事件
2122
#define loginStateChangedEvent @"JMessage.LoginStateChanged" //
2223
#define clickMessageNotificationEvent @"JMessage.ClickMessageNotification" // 点击推送 Android Only
2324
#define syncOfflineMessageEvent @"JMessage.SyncOfflineMessage" // 同步离线消息事件

ios/RCTJMessageModule/RCTJMessageModule.m

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ -(void)initNotifications {
6565
name:kJJMessageReceiveMessage
6666
object:nil];
6767

68-
// [defaultCenter addObserver:self
69-
// selector:@selector(conversationChanged:)
70-
// name:kJJMessageConversationChanged
71-
// object:nil];
68+
[defaultCenter addObserver:self
69+
selector:@selector(conversationChanged:)
70+
name:kJJMessageConversationChanged
71+
object:nil];
7272
// have
7373
[defaultCenter addObserver:self
7474
selector:@selector(didSendMessage:)
@@ -182,6 +182,10 @@ - (void)didReceiveJMessageMessage:(NSNotification *)notification {
182182
[self.bridge.eventDispatcher sendAppEventWithName:receiveMsgEvent body:notification.object];
183183
}
184184

185+
- (void)conversationChanged:(NSNotification *)notification {
186+
[self.bridge.eventDispatcher sendAppEventWithName:conversationChangeEvent body:notification.object];
187+
}
188+
185189
//#pragma mark IM - User
186190

187191

0 commit comments

Comments
 (0)