QMChatViewController-ios icon indicating copy to clipboard operation
QMChatViewController-ios copied to clipboard

Not able to get name for each message

Open Ashu opened this issue 7 years ago • 2 comments

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];
		}
	}

Ashu avatar Nov 21 '17 12:11 Ashu

Hi! Did you solve this problem? If yes, can you explain how please?

antonBezlyudnyy avatar Nov 12 '18 09:11 antonBezlyudnyy

Yes I have resolved this issue, by getting dialogs use before open chat view controller ServicesManager.instance().usersService.getUsersWithIDs((dialogs?.occupantIDs)!)

atifsaeed14 avatar Dec 02 '18 11:12 atifsaeed14