How can I get a message sender's username, regardless of their current nickname?

38 views
Skip to first unread message

Matt Newton

unread,
Jun 22, 2013, 11:00:01 PM6/22/13
to xmpp-b...@googlegroups.com
I have a chat bot operating in a multi-user conference room, and a received message looks something like this:

<message to="bot_...@server.com/xxxxxx" type="groupchat" id="(id)" from="confere...@conference-server.com/person's nickname">

In this room, users are free to use whatever nickname they want. Their nickname does not have to be anything remotely resembling the username they used to log on to the server. However, I need their actual username to perform some operations on. Is it possible for me to extract their actual username when a message is sent? I had no trouble doing this using xmpppy (python jabber library) so I'm assuming it's possible, I just haven't figured it out yet. Thanks.

Ben Langfeld

unread,
Jun 23, 2013, 11:11:38 AM6/23/13
to xmpp-b...@googlegroups.com
You'll have to keep track of presence messages from the MUC JIDs of interest to correlate with actual JID: http://xmpp.org/extensions/xep-0045.html#enter-nonanon

Let me know if you have any problems implementing such tracking.

Regards,
Ben Langfeld


--
You received this message because you are subscribed to the Google Groups "Blather" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xmpp-blather...@googlegroups.com.
To post to this group, send email to xmpp-b...@googlegroups.com.
Visit this group at http://groups.google.com/group/xmpp-blather.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Matt Newton

unread,
Jun 23, 2013, 3:08:36 PM6/23/13
to xmpp-b...@googlegroups.com, b...@langfeld.me
That looks like something I should be able to work out. I'll give it a try, thanks for your response.


On Sunday, June 23, 2013 8:11:38 AM UTC-7, Ben Langfeld wrote:
You'll have to keep track of presence messages from the MUC JIDs of interest to correlate with actual JID: http://xmpp.org/extensions/xep-0045.html#enter-nonanon

Let me know if you have any problems implementing such tracking.

Regards,
Ben Langfeld


On 22 June 2013 23:00, Matt Newton <mnew...@gmail.com> wrote:
I have a chat bot operating in a multi-user conference room, and a received message looks something like this:

<message to="bot_...@server.com/xxxxxx" type="groupchat" id="(id)" from="conference_name@conference-server.com/person's nickname">
Reply all
Reply to author
Forward
0 new messages