QMChatViewController-ios
QMChatViewController-ios copied to clipboard
Not able to get name for each message
Hi, I've a PublicGroup dialog and use QMServices, but still messageSender is nil. What could be the problem?
The QBUUser *messageSender the we get in the following method, - (NSAttributedString *)topLabelAttributedStringForItem:(QBChatMessage *)messageItem {...} for group dialog is always nil.
if (self.dialog.type != QBChatDialogTypePrivate) {
QBUUser *messageSender = [[ServicesManager instance].usersService.usersMemoryStorage userWithID:messageItem.senderID];
if (messageSender) {
topLabelText = messageSender.login;
}
else {
topLabelText = [NSString stringWithFormat:@"@%lu",(unsigned long)messageItem.senderID];
}
}
Hi! Did you solve this problem? If yes, can you explain how please?
Yes I have resolved this issue, by getting dialogs use before open chat view controller ServicesManager.instance().usersService.getUsersWithIDs((dialogs?.occupantIDs)!)