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

Fix to cleanup roster code, fixed bug in msn roster sync, updated todo with...

Fix to cleanup roster code, fixed bug in msn roster sync, updated todo with current issues, updated oscar to better handle 'groupless' contacts.

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk/src/plugins/gateway@5020 b35dd754-fafc-0310-a699-88a17e54d16e
parent 2abe9e8d
...@@ -3,18 +3,20 @@ Gateway Plugin ...@@ -3,18 +3,20 @@ Gateway Plugin
Main Todo List: Main Todo List:
- Switch to using shared rosters instead of direct roster edit for 'buddy list'
- Evaluate whether shared rosters or direct roster edit should be used for actual transport
- Use threads for transport sessions - Use threads for transport sessions
- MUC/Groupchat support
- DB files for other DB types - DB files for other DB types
- Typing notifications
- Add/remove buddies from legacy contact list - Add/remove buddies from legacy contact list
- AIM/ICQ is not pulling entire buddy list? - AIM/ICQ is not pulling entire buddy list?
- Add support for nicknames for Yahoo [not server stored like others]
- AIM/ICQ may be leaving you logged in after disconnect, not sure yet
- Add access restriction support
- Add handling of options from web interface
- MSN doesn't know the status of other contacts upon login
Future Todo List: Future Todo List:
- Buddy icons - Buddy icons
- File transfer - File transfer
- MUC/Groupchat support
- Typing notifications
...@@ -205,10 +205,6 @@ public abstract class BaseTransport implements Component { ...@@ -205,10 +205,6 @@ public abstract class BaseTransport implements Component {
session.updateStatus(getPresenceType(packet), packet.getStatus()); session.updateStatus(getPresenceType(packet), packet.getStatus());
} }
catch (NotFoundException e) { catch (NotFoundException e) {
session = this.registrationLoggedIn(registration, from, getPresenceType(packet), packet.getStatus(), packet.getPriority());
//sessionManager.storeSession(registration.getJID(), session);
sessionManager.storeSession(from, session);
// TODO: TEMPORARY: Since we are using shared groups now, we will clean up our testers rosters for them. // TODO: TEMPORARY: Since we are using shared groups now, we will clean up our testers rosters for them.
try { try {
cleanUpRoster(from, true); cleanUpRoster(from, true);
...@@ -216,6 +212,11 @@ public abstract class BaseTransport implements Component { ...@@ -216,6 +212,11 @@ public abstract class BaseTransport implements Component {
catch (UserNotFoundException ee) { catch (UserNotFoundException ee) {
throw new UserNotFoundException("Unable to find roster."); throw new UserNotFoundException("Unable to find roster.");
} }
session = this.registrationLoggedIn(registration, from, getPresenceType(packet), packet.getStatus(), packet.getPriority());
//sessionManager.storeSession(registration.getJID(), session);
sessionManager.storeSession(from, session);
} }
} }
else if (packet.getType() == Presence.Type.unavailable) { else if (packet.getType() == Presence.Type.unavailable) {
...@@ -978,12 +979,6 @@ public abstract class BaseTransport implements Component { ...@@ -978,12 +979,6 @@ public abstract class BaseTransport implements Component {
registrationManager.createRegistration(jid, this.transportType, username, password); registrationManager.createRegistration(jid, this.transportType, username, password);
} }
try {
addOrUpdateRosterItem(jid, this.getJID(), this.getDescription(), "Transports");
}
catch (UserNotFoundException e) {
throw new UserNotFoundException("User not registered with server.");
}
// Clean up any leftover roster items from other transports. // Clean up any leftover roster items from other transports.
try { try {
...@@ -992,6 +987,14 @@ public abstract class BaseTransport implements Component { ...@@ -992,6 +987,14 @@ public abstract class BaseTransport implements Component {
catch (UserNotFoundException ee) { catch (UserNotFoundException ee) {
throw new UserNotFoundException("Unable to find roster."); throw new UserNotFoundException("Unable to find roster.");
} }
try {
addOrUpdateRosterItem(jid, this.getJID(), this.getDescription(), "Transports");
}
catch (UserNotFoundException e) {
throw new UserNotFoundException("User not registered with server.");
}
} }
/** /**
......
...@@ -129,10 +129,15 @@ public class MSNSession extends TransportSession { ...@@ -129,10 +129,15 @@ public class MSNSession extends TransportSession {
public void syncUsers() { public void syncUsers() {
List<TransportBuddy> legacyusers = new ArrayList<TransportBuddy>(); List<TransportBuddy> legacyusers = new ArrayList<TransportBuddy>();
for (MsnContact friend : msnContacts.values()) { for (MsnContact friend : msnContacts.values()) {
Log.debug("Syncing contact " + friend);
ArrayList<String> friendGroups = new ArrayList<String>(); ArrayList<String> friendGroups = new ArrayList<String>();
for (MsnGroup group : friend.getBelongGroups()) { for (MsnGroup group : friend.getBelongGroups()) {
Log.debug(" Found group " + group);
friendGroups.add(group.getGroupName()); friendGroups.add(group.getGroupName());
} }
if (friendGroups.size() < 1) {
friendGroups.add("MSN Contacts");
}
legacyusers.add(new TransportBuddy(friend.getEmail().toString(), friend.getDisplayName(), friendGroups.get(0))); legacyusers.add(new TransportBuddy(friend.getEmail().toString(), friend.getDisplayName(), friendGroups.get(0)));
} }
try { try {
......
...@@ -269,8 +269,16 @@ public class OSCARSession extends TransportSession { ...@@ -269,8 +269,16 @@ public class OSCARSession extends TransportSession {
if (nickname == null) { if (nickname == null) {
nickname = buddy.getScreenname(); nickname = buddy.getScreenname();
} }
int groupid = buddy.getGroupId(); int groupid = buddy.getGroupId();
String groupname = groups.get(groupid).getGroupName(); String groupname = "Buddies";
if (groups.containsKey(groupid)) {
groupname = groups.get(groupid).getGroupName();
if (groupname.length() < 1) {
groupname = "Buddies";
}
}
legacyusers.add(new TransportBuddy(buddy.getScreenname(), nickname, groupname)); legacyusers.add(new TransportBuddy(buddy.getScreenname(), nickname, groupname));
} }
try { 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