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

Couple of bugfixes, stuck on a problem with MSN at the moment... (IOException...

Couple of bugfixes, stuck on a problem with MSN at the moment...  (IOException error)  Upgraded cindy.  Added back commons-logging to eliminate "variables" for now.

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk/src/plugins/gateway@5352 b35dd754-fafc-0310-a699-88a17e54d16e
parent 1a482151
No preview for this file type
Name | Version
---------------------------------------------
cindy.jar | 2.4.3
cindy.jar | 2.4.4
commons-logging | 1.1
irclib.jar | 1.04
jml.jar | 1.0a2 (patched)
joscar.jar | 0.9.3 (patched)
......
......@@ -882,7 +882,7 @@ public abstract class BaseTransport implements Component, RosterEventListener {
gwitem.setAskStatus(RosterItem.ASK_NONE);
changed = true;
}
if (nickname != null && !gwitem.getNickname().equals(nickname)) {
if (nickname != null && !(gwitem.getNickname() != null) && !gwitem.getNickname().equals(nickname)) {
gwitem.setNickname(nickname);
changed = true;
}
......
......@@ -131,7 +131,8 @@ public class IRCSession extends TransportSession {
* @param presenceType New presence type.
*/
public void setBuddyStatus(String username, PresenceType presenceType) {
if (!buddyStatuses.get(username).equals(presenceType)) {
PresenceType buddyPresenceType = buddyStatuses.get(username);
if (buddyPresenceType == null || !buddyPresenceType.equals(presenceType)) {
Presence p = new Presence();
if (presenceType.equals(PresenceType.unavailable)) {
p.setType(Presence.Type.unavailable);
......
......@@ -196,6 +196,7 @@ public class MSNListener extends MsnAdapter {
m.setTo(msnSession.getJIDWithHighestPriority());
m.setFrom(msnSession.getTransport().getJID());
m.setBody("Unknown error from MSN: "+throwable.toString());
throwable.printStackTrace();
msnSession.getTransport().sendPacket(m);
}
}
......
......@@ -186,8 +186,6 @@ public class MSNSession extends TransportSession {
*/
public void removeContact(RosterItem item) {
Email contact = Email.parseStr(getTransport().convertJIDToID(item.getJid()));
// TODO: JML doesn't actually -do- removal yet. Dammit.
// Well lets at least run through the motions...
MsnContact msnContact = msnContacts.get(contact.toString());
for (MsnGroup msnGroup : msnContact.getBelongGroups()) {
msnMessenger.removeFriend(contact, msnGroup.getGroupId());
......@@ -239,7 +237,6 @@ public class MSNSession extends TransportSession {
// Now we will clean up groups that we should no longer belong to.
for (MsnGroup msnGroup : msnContact.getBelongGroups()) {
if (!groups.contains(msnGroup.getGroupName())) {
// TODO: This is not going to work. removeFriend is ignored.
msnMessenger.removeFriend(contact, msnGroup.getGroupId());
}
}
......@@ -279,10 +276,18 @@ public class MSNSession extends TransportSession {
*/
public void updateStatus(PresenceType presenceType, String verboseStatus) {
if (isLoggedIn()) {
msnMessenger.getOwner().setStatus(((MSNTransport)getTransport()).convertJabStatusToMSN(presenceType));
try {
msnMessenger.getOwner().setStatus(((MSNTransport)getTransport()).convertJabStatusToMSN(presenceType));
}
catch (IllegalStateException e) {
// Hrm, not logged in? Lets fix that.
msnMessenger.getOwner().setInitStatus(((MSNTransport)getTransport()).convertJabStatusToMSN(presenceType));
msnMessenger.login();
}
}
else {
// Hrm, not logged in? Lets fix that.
msnMessenger.getOwner().setInitStatus(((MSNTransport)getTransport()).convertJabStatusToMSN(presenceType));
msnMessenger.login();
}
}
......
......@@ -169,7 +169,15 @@ public class YahooSession extends TransportSession {
for (YahooGroup group : yahooSession.getGroups()) {
for (Enumeration e = group.getMembers().elements(); e.hasMoreElements();) {
YahooUser user = (YahooUser)e.nextElement();
legacyusers.add(new TransportBuddy(user.getId(), user.getId(), group.getName()));
PseudoRosterItem rosterItem = pseudoRoster.getItem(user.getId());
String nickname = null;
if (rosterItem != null) {
nickname = rosterItem.getNickname();
}
if (nickname == null) {
nickname = user.getId();
}
legacyusers.add(new TransportBuddy(user.getId(), nickname, group.getName()));
}
}
try {
......
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