你的浏览器禁用了JavaScript, 请开启后刷新浏览器获得更好的体验!
输入关键字进行搜索
搜索:
没有找到相关结果
KevinGong
if (self.conversation.type == EMConversationTypeGroupChat){ message.chatType = EMChatTypeGroupChat; } else if (self.conversation.type == EMConversationTypeChatRoom){ message.chatType = EMChatTypeChatRoom; } __weak typeof(self) weakself = self; if (!([EMClient sharedClient].options.isAutoTransferMessageAttachments) && isUploadFile) { UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:nil message:NSLocalizedString(@"message.autoTransfer", @"Please customize the transfer attachment method") delegate:nil cancelButtonTitle:NSLocalizedString(@"sure", @"OK") otherButtonTitles:nil, nil]; [alertView show]; } else { [self addMessageToDataSource:message progress:nil]; [[EMClient sharedClient].chatManager sendMessage:message progress:^(int progress) { if (weakself.dataSource && [weakself.dataSource respondsToSelector:@selector(messageViewController:updateProgress:messageModel:messageBody:)]) { [weakself.dataSource messageViewController:weakself updateProgress:progress messageModel:nil messageBody:message.body]; } } completion:^(EMMessage *aMessage, EMError *aError) { if (!aError) { [weakself _refreshAfterSentMessage:aMessage]; } else { [weakself.tableView reloadData]; } }]; }
要回复问题请先登录或注册
1 个回复
KevinGong
if (self.conversation.type == EMConversationTypeGroupChat){
发消息后需要reload 自己的tableviewmessage.chatType = EMChatTypeGroupChat;
}
else if (self.conversation.type == EMConversationTypeChatRoom){
message.chatType = EMChatTypeChatRoom;
}
__weak typeof(self) weakself = self;
if (!([EMClient sharedClient].options.isAutoTransferMessageAttachments) && isUploadFile) {
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:nil message:NSLocalizedString(@"message.autoTransfer", @"Please customize the transfer attachment method") delegate:nil cancelButtonTitle:NSLocalizedString(@"sure", @"OK") otherButtonTitles:nil, nil];
[alertView show];
} else {
[self addMessageToDataSource:message
progress:nil];
[[EMClient sharedClient].chatManager sendMessage:message progress:^(int progress) {
if (weakself.dataSource && [weakself.dataSource respondsToSelector:@selector(messageViewController:updateProgress:messageModel:messageBody:)]) {
[weakself.dataSource messageViewController:weakself updateProgress:progress messageModel:nil messageBody:message.body];
}
} completion:^(EMMessage *aMessage, EMError *aError) {
if (!aError) {
[weakself _refreshAfterSentMessage:aMessage];
}
else {
[weakself.tableView reloadData];
}
}];
}