Commit a7378e2b 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@5020 b35dd754-fafc-0310-a699-88a17e54d16e
parent d87dbde4
......@@ -3,18 +3,20 @@ Gateway Plugin
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
- MUC/Groupchat support
- DB files for other DB types
- Typing notifications
- Add/remove buddies from legacy contact 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:
- Buddy icons
- File transfer
- MUC/Groupchat support
- Typing notifications
......@@ -205,10 +205,6 @@ public abstract class BaseTransport implements Component {
session.updateStatus(getPresenceType(packet), packet.getStatus());
}
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.
try {
cleanUpRoster(from, true);
......@@ -216,6 +212,11 @@ public abstract class BaseTransport implements Component {
catch (UserNotFoundException ee) {
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) {
......@@ -978,12 +979,6 @@ public abstract class BaseTransport implements Component {
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.
try {
......@@ -992,6 +987,14 @@ public abstract class BaseTransport implements Component {
catch (UserNotFoundException ee) {
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 {
public void syncUsers() {
List<TransportBuddy> legacyusers = new ArrayList<TransportBuddy>();
for (MsnContact friend : msnContacts.values()) {
Log.debug("Syncing contact " + friend);
ArrayList<String> friendGroups = new ArrayList<String>();
for (MsnGroup group : friend.getBelongGroups()) {
Log.debug(" Found group " + group);
friendGroups.add(group.getGroupName());
}
if (friendGroups.size() < 1) {
friendGroups.add("MSN Contacts");
}
legacyusers.add(new TransportBuddy(friend.getEmail().toString(), friend.getDisplayName(), friendGroups.get(0)));
}
try {
......
......@@ -269,8 +269,16 @@ public class OSCARSession extends TransportSession {
if (nickname == null) {
nickname = buddy.getScreenname();
}
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));
}
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