Problem with Openfire (roster presence) and Strophe.js

Hi everybody,

I got a problem when loading my roster presence. I m using BOSCH Strophe.js and an Openfire server (3.8.x)

I call my roster using this stanza, and it’s work perfectly :

1

2

3

iq = $iq({type: ``'get'``}).c(``'query'``, {xmlns: ``'jabber:iq:roster'``});

connection.sendIQ(iq, getRoster);

1

2

3

4

5

6

7

8

9

10

11

function getRoster(iq){

``$(iq).find(``'item'``).each(``function``(){

``var jid = $(``this``).attr(``'jid'``); ``// The jabber_id of your contact

``// You can probably put them in a unordered list and and use their jids as ids.

``$(``'#online'``).children(``'ul'``).append(``'<li id="'``+jid+``'"><a href="#" class="online_member"><img src="images/Offline.png" class="status"><p>'``+jid+``'</p></a></li>'``);

``});

``connection.addHandler(on_presence, ``null``, ``"presence"``);

``connection.send($pres());

}

Now, I want to load the users presence, to change their color and permit them to chat.

To make it work, I ve found a code on google :

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

function on_presence(presence){

``var presence_type = $(presence).attr(``'type'``); ``// unavailable, subscribed, etc...

``var from = $(presence).attr(``'from'``); ``// the jabber_id of the contact

``if (presence_type != ``'error'``){

``if (presence_type === ``'unavailable'``){

``alert(``'offline'``);

``}``else``{

``var show = $(presence).find(``"show"``).text(); ``// this is what gives away, dnd, etc.

``if (show === ``'chat' || show === ``''``){

``alert(``'online'``);

``}``else``{

``// etc...

``alert(``'etc'``);

``}

``}

``}

``//RETURN TRUE!!!!!!!!!

``return true``;

}

Actually, it works for other people, but not for me. So I guess the problem is from my Openfire configuration.

In the console, I try to change the “subscription” property, but it generates an erreur on the java lib (null pointer exception), and I dont see any modification in the ofroster table on MYSQL. So I ve tried manually to change the value of ask, recv, and sub but not way, the presence is not managed.

On the other side, when I log an account twice, the presence is managed, I see the modification, and I can chat.

Any idea ?

Sorry for the bad english, I m a french student ^^’.

Thanks for all,

Skahrz

Up :-/

Up, I have found smth this morning while debuggin’.

These are my log of strophe js

SENT: RECV: stream:featuresDIGEST-MD5PLAINCRAM-MD5zlib</stream:features>SENT: RECV: cmVhbG09InBjLW1hcnZpbiIsbm9uY2U9ImpxR1 JvTmo2d29rbVlxZjl4eTl6Mkp3ekJ1Y1UxM2lpcHM0UzVsSWIiLHFvcD0iYXV0aCIsY2hhcnNldD11dG YtOCxhbGdvcml0aG09bWQ1LXNlc3M=SENT: dXNlcm5hbWU9InRlc3QiLHJlYWxtPSJwYy1tYX J2aW4iLG5vbmNlPSJqcUdSb05qNndva21ZcWY5eHk5ejJKd3pCdWNVMTNpaXBzNFM1bEliIixjbm9uY2 U9IjAxMDI4ZjQzMzExZDFkMGJhMzE2NjU3YmNhZGU5YWM0IixuYz0iMDAwMDAwMDEiLHFvcD0iYXV0aC IsZGlnZXN0LXVyaT0ieG1wcC9wYy1tYXJ2aW4iLHJlc3BvbnNlPSJlYzBhNzZkYTg0ZWI2Nzg4Y2IwMm M4OGQ1NjJiNWE4ZiIsY2hhcnNldD0idXRmLTgiRECV: cnNwYXV0aD04YmQyN2E3OTE5M2FkNTNhNjhmZD k1NWJjOTIyNDM3YQ==SENT: RECV: stream:featureszlib</stream:features>SENT: RECV: test@pc-marvin/e66830e1</bi nd>SENT: RECV: SENT: SENT: RECV: RECV: FriendsSENT: RECV: SENT: RECV: SENT: RECV: <body xmlns='http://jabber.org/protocol/httpbind’/>

There are errors with the markup.

In fact, the domain of my application is app.fr . But the soft tried to send stanzas to my computer domain.

I dont know how to change it. I m connecting on the write domain btw… (first request, @app.fr)

Any idea ?

The problem is due to a remote-server-not-found I guess.

It means that I have a problem with my DNS.

Any idea to bypass this ?