Can't update status

Hello,

I search to solve my problem for a moment but I don’t find a solution. I used the example in smack’s documentation to update my gtalk’s status but it doesn’t work.

The main problem it is : there is no exception raise so I can’t know why it doesn’t work.

Here my code :

… Some code …

connection.login( ApplicationPreference.getJabberUser(),

appBean.getTextEncryptor().decrypt(ApplicationPreference.getJabberPasswordEncode d() ) );

// Create a new presence. Pass in false to indicate we’re unavailable.

Presence presence = new Presence( Presence.Type.available);

presence.setMode(Presence.Mode.available);

presence.setType(Presence.Type.available);

presence.setStatus(newStatus);

// Send the packet (assume we have a XMPPConnection instance called “con”).

connection.sendPacket(presence);

System.out.println( getMyStatus(appBean) );

connection.disconnect();

Is someone could help me to find where I am doing wrong ?

Thank you.

Did you try logging in using another client as another user, and seeing if the status changes? My code for creating and sending the presence is essentially the same, and it works for me, so the problem may be with retrieving the presence.

Yes, I had the same reflexion as you. So I double check my status with my grilfriends’s account. But I ve still got the same problem. (No update of my status)

Any idea ?

Something wrong with Google Talk perhaps ?

Hello,

I have still the same problem.

I make a few searches into this forum and on Google but I still not found any explanation to why it doesn’t work and what can I do wrong.

If someone could help me, I will be happy

regards,

Seb

HI,

I am not experienced in IM that much, however wat i feel the problem lies in that u disconnect yourself at a cerain point, so try creating a program that keeps u alive after loggin u in and then update the presence, once that is done check the status, but still u should be logged. Worth trying…

It doen’t work. I make a try in debug mode with a breakpoint before disconnection

HI,

Have u tried using RosterListener, i have tried with RosterListener and i am able to see the presence when ever other user changes it or log off…

I am using Smack as my API…

I will get a look tonight after job.

Thank you for your messages

I am still have the same problem. I run into debug mode.

I send this packet to set my status :

for testing 24away

I forced the language and set the mode to away for testing.

So any suggestion ?

I update on svn my classes which managing Jabber :

http://code.google.com/p/socialbridge/source/browse/trunk/SocialBridge/src/com/c ba/jabberTwitterBridge/arch/com/JabberServices.java

It is perhaps the way I connected Jabber.

If someone can help me…

Good news,

I found why my status is not update :

http://code.google.com/apis/talk/jep_extensions/shared_status.html#5

The server rewrites and sends out the following value to all subscribed contacts and other instances. Note that the <status> value used is the current shared value, not the value just sent by the <presence> stanza.

I must send a xml message like this :

<iq type='set' to='##########@gmail.com/orchard' id='ss-2'>
  <query xmlns='google:shared-status' version='2'>
    <status>**Juliet's here**</status>
    <show>default</status>
    <status-list show='default'>
        <status>Juliet's here</status>
        <status>Pining away</status>
        <status>Wherefor indeed</status>
        <status>Thinking about the sun</status>
    </status-list>
    <status-list show='dnd'>
        <status>Chilling with Mercutio</status>
        <status>Visiting the monk</status>
    </status-list>
    <invisible value='false'/>
  </query>
</iq>

Well just to work on it…

–> Yes, it is working now. I must do a new class which herite of IQ. This class allow Smack to update status into Google.

You can get source here :

http://code.google.com/p/socialbridge/source/browse/trunk/SocialBridge/src/com/c ba/jabberTwitterBridge/arch/com/jabber/PresenceGoogle.java