Commit 12d10395 authored by Daniel Henninger's avatar Daniel Henninger Committed by dhenninger

[GATE-9] Fixed lack of visible MSN contacts at login.

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@5064 b35dd754-fafc-0310-a699-88a17e54d16e
parent 9eb1b529
......@@ -2,7 +2,7 @@ Name | Version
---------------------------------------------
cindy.jar | 2.4.3
commons-logging.jar | 1.1
jml.jar | 1.0a2
jml.jar | 1.0a2 (patched)
jmml.jar | cvs-2006-07-19
joscar.jar | 0.9.3 (patched)
picocontainer.jar | 1.2.0
......
......@@ -18,6 +18,9 @@ import net.sf.jml.MsnSwitchboard;
import net.sf.jml.MsnContact;
import net.sf.jml.MsnMessenger;
import net.sf.jml.message.MsnInstantMessage;
import net.sf.jml.message.MsnControlMessage;
import net.sf.jml.message.MsnDatacastMessage;
import net.sf.jml.message.MsnUnknownMessage;
import java.util.Date;
......@@ -71,25 +74,49 @@ public class MSNListener extends MsnAdapter {
msnSession.getTransport().sendPacket(m);
}
/**
* Handles incoming control messages from MSN.
*/
public void controlMessageReceived(MsnSwitchboard switchboard, MsnControlMessage message, MsnContact friend) {
Log.debug("MSN: Received control msg to " + switchboard + " from " + friend + ": " + message);
}
/**
* Handles incoming datacast messages from MSN.
*/
public void datacastMessageReceived(MsnSwitchboard switchboard, MsnDatacastMessage message, MsnContact friend) {
Log.debug("MSN: Received database msn to " + switchboard + " from " + friend + ": " + message);
}
/**
* Handles incoming unknown messages from MSN.
*/
public void unknownMessageReceived(MsnSwitchboard switchboard, MsnUnknownMessage message, MsnContact friend) {
Log.debug("MSN: Received database msn to " + switchboard + " from " + friend + ": " + message);
}
/**
* The user's login has completed and was accepted.
*/
public void loginCompleted(MsnMessenger messenger) {
Log.debug("MSN login completed");
Presence p = new Presence();
p.setTo(msnSession.getJID());
p.setFrom(msnSession.getTransport().getJID());
msnSession.getTransport().sendPacket(p);
msnSession.getRegistration().setLastLogin(new Date());
msnSession.setLoginStatus(true);
}
/**
* Contact list initialization has completed.
*/
public void contactListInitCompleted(MsnMessenger messenger) {
Log.debug("Contact list init completed.");
}
/**
* Contact list has been synced.
*/
public void contactListSyncCompleted(MsnMessenger messenger) {
Log.debug("Contact list sync completed.");
for (MsnContact msnContact : messenger.getContactList().getContacts()) {
Log.debug("Got contact "+msnContact);
msnSession.storeFriend(msnContact);
......@@ -101,6 +128,7 @@ public class MSNListener extends MsnAdapter {
* A friend for this user has changed status.
*/
public void contactStatusChanged(MsnMessenger messenger, MsnContact friend) {
Log.debug("Got MSN status "+friend);
Presence p = new Presence();
p.setTo(msnSession.getJID());
p.setFrom(msnSession.getTransport().convertIDToJID(friend.getEmail().toString()));
......@@ -109,4 +137,23 @@ public class MSNListener extends MsnAdapter {
msnSession.storeFriend(friend);
}
/**
* Owner status has changed.
*/
public void ownerStatusChanged(MsnMessenger messenger) {
Log.debug("Owner status has changed: " + messenger);
Presence p = new Presence();
p.setTo(msnSession.getJID());
p.setFrom(msnSession.getTransport().getJID());
((MSNTransport)msnSession.getTransport()).setUpPresencePacket(p, messenger.getOwner().getStatus());
msnSession.getTransport().sendPacket(p);
}
/**
* Catches MSN exceptions.
*/
public void exceptionCaught(MsnMessenger messenger, Throwable throwable) {
Log.debug("Caught MSN exception: "+messenger+":"+throwable.toString());
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment