update Imdn status

This commit is contained in:
Danmei Chen 2019-01-25 10:55:19 +01:00
parent b62cf43995
commit 14b172f2ad
3 changed files with 18 additions and 5 deletions

View file

@ -34,6 +34,7 @@
@property (weak, nonatomic) IBOutlet UITableView *tableView;
- (IBAction)onBackClick:(id)sender;
- (void)updateImdnList;
@end

View file

@ -54,12 +54,18 @@ static UICompositeViewDescription *compositeDescription = nil;
_tableView.delegate = self;
_tableView.dataSource = self;
_displayedList = linphone_chat_message_get_participants_by_imdn_state(_msg, LinphoneChatMessageStateDisplayed);
_receivedList = linphone_chat_message_get_participants_by_imdn_state(_msg, LinphoneChatMessageStateDeliveredToUser);
_notReceivedList = linphone_chat_message_get_participants_by_imdn_state(_msg, LinphoneChatMessageStateDelivered);
_errorList = linphone_chat_message_get_participants_by_imdn_state(_msg, LinphoneChatMessageStateNotDelivered);
[self updateImdnList];
}
[_tableView reloadData];
- (void)updateImdnList {
if (_msg) {
_displayedList = linphone_chat_message_get_participants_by_imdn_state(_msg, LinphoneChatMessageStateDisplayed);
_receivedList = linphone_chat_message_get_participants_by_imdn_state(_msg, LinphoneChatMessageStateDeliveredToUser);
_notReceivedList = linphone_chat_message_get_participants_by_imdn_state(_msg, LinphoneChatMessageStateDelivered);
_errorList = linphone_chat_message_get_participants_by_imdn_state(_msg, LinphoneChatMessageStateNotDelivered);
[_tableView reloadData];
}
}
- (void)fitContent {

View file

@ -88,6 +88,7 @@
linphone_chat_message_set_user_data(_message, (void *)CFBridgingRetain(self));
LinphoneChatMessageCbs *cbs = linphone_chat_message_get_callbacks(_message);
linphone_chat_message_cbs_set_msg_state_changed(cbs, message_status);
linphone_chat_message_cbs_set_participant_imdn_state_changed(cbs, participant_imdn_status);
linphone_chat_message_cbs_set_user_data(cbs, (void *)_event);
}
@ -369,6 +370,11 @@ static void message_status(LinphoneChatMessage *msg, LinphoneChatMessageState st
[view.tableController updateEventEntry:event];
}
static void participant_imdn_status(LinphoneChatMessage* msg, const LinphoneParticipantImdnState *state) {
ChatConversationImdnView *imdnView = VIEW(ChatConversationImdnView);
[imdnView updateImdnList];
}
- (void)displayImdmStatus:(LinphoneChatMessageState)state {
if (state == LinphoneChatMessageStateDeliveredToUser) {
[_imdmIcon setImage:[UIImage imageNamed:@"chat_delivered"]];