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

[GATE-118] Buddy added me support added, but needs testing.

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk/src/plugins/gateway@7345 b35dd754-fafc-0310-a699-88a17e54d16e
parent 62131750
......@@ -158,5 +158,46 @@ public class BOSConnection extends BasicFlapConnection {
// Log.debug("RECEIVED META SHORT INFO: "+msic);
// oscarSession.updateRosterNickname(String.valueOf(msic.getUIN()), msic.getNickname());
}
else if (cmd instanceof BuddyAddedYouCmd) {
BuddyAddedYouCmd bay = (BuddyAddedYouCmd)cmd;
Presence p = new Presence();
p.setType(Presence.Type.subscribe);
p.setTo(oscarSession.getJID());
p.setFrom(oscarSession.getTransport().convertIDToJID(bay.getUin()));
oscarSession.getTransport().sendPacket(p);
}
else if (cmd instanceof BuddyAuthRequest) {
BuddyAuthRequest bar = (BuddyAuthRequest)cmd;
Presence p = new Presence();
p.setType(Presence.Type.subscribe);
p.setTo(oscarSession.getJID());
p.setFrom(oscarSession.getTransport().convertIDToJID(bar.getScreenname()));
oscarSession.getTransport().sendPacket(p);
}
else if (cmd instanceof AuthReplyCmd) {
AuthReplyCmd ar = (AuthReplyCmd)cmd;
if (ar.isAccepted()) {
Presence p = new Presence();
p.setType(Presence.Type.subscribed);
p.setTo(oscarSession.getJID());
p.setFrom(oscarSession.getTransport().convertIDToJID(ar.getSender()));
oscarSession.getTransport().sendPacket(p);
}
else {
// Hrm, should we do something on a deny?
}
}
else if (cmd instanceof AuthFutureCmd) {
AuthFutureCmd af = (AuthFutureCmd)cmd;
Presence p = new Presence();
p.setType(Presence.Type.subscribe);
p.setTo(oscarSession.getJID());
p.setFrom(oscarSession.getTransport().convertIDToJID(af.getUin()));
oscarSession.getTransport().sendPacket(p);
}
}
}
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