Commit af4184c3 authored by Daniel Henninger's avatar Daniel Henninger Committed by dhenninger

[GATE-140] Added MSN typing notification support.

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk/src/plugins/gateway@7278 b35dd754-fafc-0310-a699-88a17e54d16e
parent f2c53fa8
...@@ -77,7 +77,15 @@ public class MSNListener extends MsnAdapter { ...@@ -77,7 +77,15 @@ public class MSNListener extends MsnAdapter {
* Handles incoming control messages from MSN. * Handles incoming control messages from MSN.
*/ */
public void controlMessageReceived(MsnSwitchboard switchboard, MsnControlMessage message, MsnContact friend) { public void controlMessageReceived(MsnSwitchboard switchboard, MsnControlMessage message, MsnContact friend) {
Log.debug("MSN: Received control msg to " + switchboard + " from " + friend + ": " + message); if (message.getTypingUser() != null) {
msnSession.getTransport().sendComposingNotification(
msnSession.getJIDWithHighestPriority(),
msnSession.getTransport().convertIDToJID(friend.getEmail().toString())
);
}
else {
Log.debug("MSN: Received unknown control msg to " + switchboard + " from " + friend + ": " + message);
}
} }
/** /**
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
package org.jivesoftware.wildfire.gateway.protocols.msn; package org.jivesoftware.wildfire.gateway.protocols.msn;
import net.sf.jml.*; import net.sf.jml.*;
import net.sf.jml.message.MsnControlMessage;
import net.sf.jml.impl.BasicMessenger; import net.sf.jml.impl.BasicMessenger;
import net.sf.jml.impl.MsnMessengerFactory; import net.sf.jml.impl.MsnMessengerFactory;
import org.jivesoftware.util.Log; import org.jivesoftware.util.Log;
...@@ -394,7 +395,14 @@ public class MSNSession extends TransportSession { ...@@ -394,7 +395,14 @@ public class MSNSession extends TransportSession {
* @see org.jivesoftware.wildfire.gateway.TransportSession#sendChatState(org.xmpp.packet.JID, org.jivesoftware.wildfire.gateway.ChatStateType) * @see org.jivesoftware.wildfire.gateway.TransportSession#sendChatState(org.xmpp.packet.JID, org.jivesoftware.wildfire.gateway.ChatStateType)
*/ */
public void sendChatState(JID jid, ChatStateType chatState) { public void sendChatState(JID jid, ChatStateType chatState) {
// TODO: Handle this Email jidEmail = Email.parseStr(getTransport().convertJIDToID(jid));
MsnControlMessage mcm = new MsnControlMessage();
mcm.setTypingUser(msnMessenger.getOwner().getEmail().getEmailAddress());
for (MsnSwitchboard sb : msnMessenger.getActiveSwitchboards()) {
if (sb.containContact(jidEmail)) {
sb.sendMessage(mcm, true);
}
}
} }
/** /**
......
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