[sameplace] How to get "actual" resource from JID

0 views
Skip to first unread message

sylver

unread,
Apr 26, 2010, 11:15:28 PM4/26/10
to SamePlace/xmpp4moz
Hi,

For login, I've set my account object like so:

account = XMPP.accounts;
account.jid = "st...@wars.com/luke";
account.password = "lucas";

But during chat session, and by looking at XMPP console, I notice that
X4M append 8 more chars to my resource, making it looking like so:

"st...@wars.com/lukeAC5D5EFA"

My question is, is there a function in X4M that returns
"lukeAC5D5EFA" ?

If not, then my next move will be to listen to an incoming message,
grab the "to" value, and then grab the resource. But that sounds quite
a lot to do :D

Any suggestion would be greatly appreciated.

Thanks :D

--
Documentation: http://github.com/bard/sameplace/wikis/home
Discussions: http://groups.google.com/group/sameplace
Bug tracker: https://bugs.launchpad.net/sameplace

Sonny Piers

unread,
Apr 27, 2010, 5:41:45 AM4/27/10
to same...@googlegroups.com
I've never noticed that x4m append chars to the resource.

Maybe x4m do it because you are already connected with the resource "luke" ?

On 04/27/2010 05:15 AM, sylver wrote:
> Hi,
>
> For login, I've set my account object like so:
>
> account = XMPP.accounts;
> account.jid = "st...@wars.com/luke";
> account.password = "lucas";
>
> But during chat session, and by looking at XMPP console, I notice that
> X4M append 8 more chars to my resource, making it looking like so:
>
> "st...@wars.com/lukeAC5D5EFA"
>
> My question is, is there a function in X4M that returns
> "lukeAC5D5EFA" ?
>
> If not, then my next move will be to listen to an incoming message,
> grab the "to" value, and then grab the resource. But that sounds quite
> a lot to do :D
>
> Any suggestion would be greatly appreciated.
>
> Thanks :D
>
>


--
Sonny Piers
Jabber: so...@papaya.im
GSM: +32 494 58 78 96

sylver

unread,
Apr 27, 2010, 10:18:18 PM4/27/10
to SamePlace/xmpp4moz
Hi Sonny, Thanks for bringing that up :D

I did some testing and these are my results:

Format : <original resource> ==> <after xmpp4moz added some chars>
lu ==> lu335C6C3E
ThisResourceIsLong ==> ThisResour543A3C91
ThisResourceIsEvenLonger ==> ThisResour031D14AD
lukewarm ==> lukewarm211CE668

Another friend of mine suggested to get the "to" value, in the <iq>
roster reply stanza. I'll do that for now :D

On Apr 27, 5:41 pm, Sonny Piers <sonny.pi...@gmail.com> wrote:
> I've never noticed that x4m append chars to the resource.
>
> Maybe x4m do it because you are already connected with the resource "luke" ?
>
> On 04/27/2010 05:15 AM, sylver wrote:
>
>
>
> > Hi,
>
> > For login, I've set my account object like so:
>
> > account = XMPP.accounts;
> > account.jid = "s...@wars.com/luke";
> > account.password = "lucas";
>
> > But during chat session, and by looking at XMPP console, I notice that
> > X4M append 8 more chars to my resource, making it looking like so:
>
> > "s...@wars.com/lukeAC5D5EFA"
Reply all
Reply to author
Forward
0 new messages