Commit 9f813461 authored by Daniel Henninger's avatar Daniel Henninger Committed by dhenninger

[GATE-77] Updated JML to fix MSN protocol bug/other improvements

[GATE-54] Disabled last of AIM/ICQ deletion possibilities
[GATE-89] Added more debugging to try to figure out yahoo issues
[GATE-83] Fixed poor handling of status changes
[GATE-59] Always set initial status to available for yahoo

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@5762 b35dd754-fafc-0310-a699-88a17e54d16e
parent 2cd0c2c7
......@@ -2,7 +2,7 @@ Name | Version
---------------------------------------------
cindy.jar | 2.4.4
irclib.jar | 1.04
jml.jar | svn-20061008
jml.jar | svn-20061019
joscar-common.jar | svn-20061016
joscar-protocol.jar | svn-20061016
picocontainer.jar | 1.2.0
......
......@@ -117,6 +117,22 @@ public abstract class TransportSession implements Runnable {
}
}
/**
* Updates the priority of a resource.
*
* @param resource Resource string
* @param priority New priority
*/
public void updateResource(String resource, Integer priority) {
for (Integer i : resources.keySet()) {
if (resources.get(i).equals(resource)) {
resources.remove(i);
break;
}
}
resources.put(priority, resource);
}
/**
* Removes all resources associated with a session.
*/
......@@ -202,8 +218,8 @@ public abstract class TransportSession implements Runnable {
* @param priority New priority of resource
*/
public void updatePriority(String resource, Integer priority) {
removeResource(resource);
addResource(resource, priority);
updateResource(resource, priority);
// TODO: should potentially ask for status of highest priority
}
/**
......
......@@ -224,13 +224,13 @@ public class OSCARSession extends TransportSession {
* @see org.jivesoftware.wildfire.gateway.TransportSession#removeContact(org.jivesoftware.wildfire.roster.RosterItem)
*/
public void removeContact(RosterItem item) {
String legacyId = getTransport().convertJIDToID(item.getJid());
for (BuddyItem i : buddies.values()) {
if (i.getScreenname().equalsIgnoreCase(legacyId)) {
request(new DeleteItemsCmd(i.toSsiItem()));
buddies.remove(""+i.getGroupId()+"."+i.getId());
}
}
// String legacyId = getTransport().convertJIDToID(item.getJid());
// for (BuddyItem i : buddies.values()) {
// if (i.getScreenname().equalsIgnoreCase(legacyId)) {
// request(new DeleteItemsCmd(i.toSsiItem()));
// buddies.remove(""+i.getGroupId()+"."+i.getId());
// }
// }
}
/**
......
......@@ -18,10 +18,7 @@ import org.xmpp.packet.JID;
import org.xmpp.packet.Message;
import org.xmpp.packet.PacketError;
import org.xmpp.packet.Presence;
import ymsg.network.LoginRefusedException;
import ymsg.network.Session;
import ymsg.network.YahooGroup;
import ymsg.network.YahooUser;
import ymsg.network.*;
import java.io.IOException;
import java.util.*;
......@@ -99,6 +96,7 @@ public class YahooSession extends TransportSession {
public void run() {
try {
loginAttempts++;
yahooSession.setStatus(StatusConstants.STATUS_AVAILABLE);
yahooSession.login(registration.getUsername(), registration.getPassword());
setLoginStatus(TransportLoginStatus.LOGGED_IN);
......
......@@ -175,7 +175,7 @@ public class YahooSessionListener implements SessionListener {
* @see ymsg.network.event.SessionListener#errorPacketReceived(ymsg.network.event.SessionErrorEvent)
*/
public void errorPacketReceived(SessionErrorEvent event) {
//Log.error(event.toString());
Log.error("Error from yahoo: "+event.getMessage()+", Code:"+event.getCode());
Message m = new Message();
m.setType(Message.Type.error);
m.setTo(yahooSession.getJIDWithHighestPriority());
......@@ -188,8 +188,7 @@ public class YahooSessionListener implements SessionListener {
* @see ymsg.network.event.SessionListener#inputExceptionThrown(ymsg.network.event.SessionExceptionEvent)
*/
public void inputExceptionThrown(SessionExceptionEvent event) {
//event.getException().printStackTrace();
//Log.error(event.toString());
Log.error("Input error from yahoo: "+event.getMessage(), event.getException());
Message m = new Message();
m.setType(Message.Type.error);
m.setTo(yahooSession.getJIDWithHighestPriority());
......
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