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

[GATE-85] Finished up for other transports (IRC and AIM/ICQ)

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk/src/plugins/gateway@5722 b35dd754-fafc-0310-a699-88a17e54d16e
parent bd2fe804
......@@ -15,6 +15,7 @@ import org.jivesoftware.wildfire.roster.RosterItem;
import org.jivesoftware.util.Log;
import org.xmpp.packet.JID;
import org.xmpp.packet.Presence;
import org.xmpp.packet.PacketError;
import org.schwering.irc.lib.IRCConnection;
import java.io.IOException;
......@@ -244,9 +245,14 @@ public class IRCSession extends TransportSession {
public void retrieveContactStatus(JID jid) {
String contact = getTransport().convertJIDToID(jid);
Presence p = new Presence();
if (buddyStatuses.containsKey(contact)) {
if (buddyStatuses.get(contact).equals(PresenceType.unavailable)) {
p.setType(Presence.Type.unavailable);
}
}
else {
p.setError(PacketError.Condition.forbidden);
}
p.setTo(jid);
p.setFrom(getTransport().convertIDToJID(contact));
getTransport().sendPacket(p);
......
......@@ -21,6 +21,7 @@ import org.jivesoftware.util.Log;
import org.xmpp.packet.Message;
import org.xmpp.packet.Presence;
import org.xmpp.packet.JID;
import org.xmpp.packet.PacketError;
import net.kano.joscar.ByteBlock;
import net.kano.joscar.OscarTools;
import net.kano.joscar.BinaryTools;
......@@ -285,9 +286,10 @@ public abstract class BasicFlapConnection extends BaseFlapConnection {
oscarSession.getTransport().sendPacket(p);
}
else {
Presence p = new Presence(Presence.Type.unavailable);
Presence p = new Presence();
p.setTo(oscarSession.getJID());
p.setFrom(oscarSession.getTransport().convertIDToJID(sn));
p.setError(PacketError.Condition.forbidden);
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