Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get nickname of MUC message? #678

Open
funkenstrahlen opened this issue Feb 13, 2016 · 2 comments
Open

How to get nickname of MUC message? #678

funkenstrahlen opened this issue Feb 13, 2016 · 2 comments

Comments

@funkenstrahlen
Copy link

When I have joined a MUC room with XMPPFramwork I receive new messages via the delegate method:

func xmppRoom(sender: XMPPRoom!, didReceiveMessage message: XMPPMessage!, fromOccupant occupantJID: XMPPJID!) {

}

How can I get the nickname of the user who send the message?

I tried message.from().user but this did not print the nickname.

I now use message.fromStr())!.lastPathComponent! but this feels very wrong.

Any better way to do this?

@ghost
Copy link

ghost commented Apr 20, 2016

Check the http://www.xmpp.org/extensions/xep-0172.html, basically you should add a child element into the message stanza.

`

Call me Ishmael Ishmael `

Or you can use message.from().resource, the resource in MUC is the nickname of the sender.

@Rafeeq1
Copy link

Rafeeq1 commented Jul 25, 2016

In same case if I want the message sender avatar. How to get that in group chat?

Basically in my group chat I can get the avatar from XMPPUserCoreDataStorageObject this is only if sender is in my roster list. But in my case the sender may be added to group by some one so he may be not in my friend list. so can you please help in this to get the user avatar who are not in my roster list .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants