Issue
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
Solution
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:
Answered By - mesibo
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.