[libpurple] Is there a way to strip jid resource?
darkrain42 at pidgin.im
Sun Jun 5 23:18:38 EDT 2011
And Michał Kazior spoke on 06/05/2011 03:01 PM, saying:
> I'm trying to strip a jid resource, example:
> bob at domain.tld/HomeXYZ -> bob at domain.tld
> I know that I could just split it, but that seems wrong to me.
> Shouldn't it be possible to do it with libpurple alone?
The API libpurple exposes is generally protocol-neutral, but in this case,
you can generally call purple_normalize(account, "foo at example.com/Home"),
which will return the bare JID.
Note that if you pass a valid account AND the JID is part of an active MUC
(i.e. you're in it), you'll get the full JID.
That said, what the protocol plugin does is baiscally just split on @ and
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 900 bytes
Desc: OpenPGP digital signature
More information about the Support