I tried to revamp mesibo reply message and have problem when getting the person name, this is the code I use I use repliedToMessage to get reply information, but give wrong person name, for example I reply my message but the profile name I got from repliedToMessage return opposite person name
How to determine the reply person name, it's reply from own or opposite message?
Update : i change the code to mesibo suggested answer
it works for personal profile message, but still have a problem in group message
in group profile reply name still show self profile name
The profile is always for the peer. To display the proper name, you need to check if the replied message is incoming or outgoing.
You can call isIncoming()
or isOutgoing()
on the MesiboMessage object returned by repliedToMessage()
to determine the direction.
For example:
MesiboMessage rm = msg.getRepliedToMessage();
if(rm.isIncoming()) {
// display name from the profile
} else if(rm.isOutgoing()) {
// display name from self profile
}
Please refer to the example in the following documentation: