powered by Jive Software

MSN: Initial personal message

initially setting the personal message is not working for msn. because the initial status is set in an extra command:

msnMessenger.getOwner().setInitStatus(((MSNTransport)getTransport()).convertXMPP StatusToMSN(presenceType));

/code

and the updateStatus is not called up on login (like in oscar). so it’s only set after a second presence.

i added this (analog to oscar) to got it working:

Index: src/java/org/jivesoftware/openfire/gateway/protocols/msn/MSNSession.java

===================================================================

— src/java/org/jivesoftware/openfire/gateway/protocols/msn/MSNSession.java (revision 9042)

+++ src/java/org/jivesoftware/openfire/gateway/protocols/msn/MSNSession.java (working copy)

@@ -97,6 +97,7 @@

  • @see org.jivesoftware.openfire.gateway.session.TransportSession#logIn(org.jivesoftwa re.openfire.gateway.type.PresenceType, String)

*/

public void logIn(PresenceType presenceType, String verboseStatus) {

  •   setPendingPresenceAndStatus(presenceType, verboseStatus);
    

if (!isLoggedIn()) {

Log.debug("Creating MSN session for " + registration.getUsername());

msnMessenger = MsnMessengerFactory.createMsnMessenger(registration.getUsername(), registration.getPassword());

/code

Index: src/java/org/jivesoftware/openfire/gateway/protocols/msn/MSNListener.java

===================================================================

— src/java/org/jivesoftware/openfire/gateway/protocols/msn/MSNListener.java (revision 9042)

+++ src/java/org/jivesoftware/openfire/gateway/protocols/msn/MSNListener.java (working copy)

@@ -165,6 +165,7 @@

public void loginCompleted(MsnMessenger messenger) {

Log.debug("MSN: Login completed for "+messenger.getOwner().getEmail());

getSession().setLoginStatus(TransportLoginStatus.LOGGED_IN);

  •    getSession().updateStatus(getSession().getPresence(), getSession().getVerboseStatus());
    

}

/code

perhaps a better solution is to add it to setInitStatus in the jml library

Thanks notz! GATE-343

it seem’s that updatingStatus right after succesfull login sometimes causes that online presences from users are not sent to client. i don’t know why.

setting after sync users (like oscar) seems to work.

public void syncUsers() {

try {

getTransport().syncLegacyRoster(getJID(), buddyManager.getBuddies());

}

catch (UserNotFoundException e) {

Log.error("Unable to sync MSN contact list for " + getJID(), e);

}

buddyManager.activate();

updateStatus(getPresence(), getVerboseStatus());

}

/code

but in the meantime the verbose status get overidden by ownerStatusChanged event:

changing it to this, saves the verboseStatus. i don’t know if need this ownerStatusChanged, because it also results in a duplicate presenceMessage.

public void ownerStatusChanged(MsnMessenger messenger) {

getSession().setPresenceAndStatus(((MSNTransport)getSession().getTransport()).co nvertMSNStatusToXMPP(messenger.getOwner().getStatus()), getSession().getVerboseStatus());

// TODO: Why does JML not let us see our personal message (getPersonalMessage)

}

/code

Message was edited by: notz

I went ahead and fixed it in JML. =)