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

Updated JML and joscar to latest versions.

[GATE-64] Added support for setting hostname and port of all services, including irc.

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@5922 b35dd754-fafc-0310-a699-88a17e54d16e
parent ed92cfa5
......@@ -2,10 +2,10 @@ Name | Version
---------------------------------------------
cindy.jar | 2.4.4
irclib.jar | 1.04
jml.jar | svn-20061021
joscar-client.jar | svn-20061026
jml.jar | svn-20061103
joscar-client.jar | svn-20061103
joscar-common.jar | svn-20061026
joscar-protocol.jar | svn-20061026
joscar-protocol.jar | svn-20061103
picocontainer.jar | 1.2.0
ymsg_network.jar | 0.61 (patched)
ymsg_support.jar | 0.61 (patched)
......@@ -13,6 +13,7 @@ package org.jivesoftware.wildfire.gateway.protocols.irc;
import org.jivesoftware.wildfire.gateway.*;
import org.jivesoftware.wildfire.roster.RosterItem;
import org.jivesoftware.util.Log;
import org.jivesoftware.util.JiveGlobals;
import org.xmpp.packet.JID;
import org.xmpp.packet.Presence;
import org.xmpp.packet.PacketError;
......@@ -49,8 +50,8 @@ public class IRCSession extends TransportSession {
buddyStatuses.put(contact, PresenceType.unavailable);
}
String server = "irc.freenode.net";
int[] ports = new int[] { 7000, 6667 };
String server = JiveGlobals.getProperty("plugin.gateway.irc.connecthost", "irc.freenode.net");
int[] ports = new int[] { JiveGlobals.getIntProperty("plugin.gateway.irc.connectport", 7000) };
String username = registration.getUsername();
String password = registration.getPassword();
password = (password == null || password.equals("")) ? null : password;
......
......@@ -14,6 +14,7 @@ import net.sf.jml.*;
import net.sf.jml.impl.BasicMessenger;
import net.sf.jml.impl.MsnMessengerFactory;
import org.jivesoftware.util.Log;
import org.jivesoftware.util.JiveGlobals;
import org.jivesoftware.wildfire.gateway.*;
import org.jivesoftware.wildfire.roster.RosterItem;
import org.jivesoftware.wildfire.user.UserNotFoundException;
......@@ -83,7 +84,9 @@ public class MSNSession extends TransportSession {
msnMessenger.setLogIncoming(false);
msnMessenger.setLogOutgoing(false);
msnMessenger.addListener(new MSNListener(this));
msnMessenger.login();
((BasicMessenger)msnMessenger).login(
JiveGlobals.getProperty("plugin.gateway.msn.connecthost", "messenger.hotmail.com"),
JiveGlobals.getIntProperty("plugin.gateway.msn.connectport", 1863));
}
catch (Exception e) {
Log.error("MSN user is not able to log in: " + msnMessenger.getOwner().getEmail(), e);
......
......@@ -43,13 +43,13 @@ public class LoginConnection extends BaseFlapConnection {
}
else if (e.getNewState() == ClientFlapConn.STATE_FAILED) {
//TODO: Do we need to catch these?
// Message m = new Message();
// m.setType(Message.Type.error);
// m.setFrom(this.getMainSession().getTransport().getJID());
// m.setTo(this.getMainSession().getJIDWithHighestPriority());
// m.setBody("Connection failed: " + e.getReason());
// this.getMainSession().getTransport().sendPacket(m);
// this.getMainSession().logOut();
Message m = new Message();
m.setType(Message.Type.error);
m.setFrom(this.getMainSession().getTransport().getJID());
m.setTo(this.getMainSession().getJIDWithHighestPriority());
m.setBody("Connection failed: " + e.getReason());
this.getMainSession().getTransport().sendPacket(m);
this.getMainSession().logOut();
}
else if (e.getNewState() == ClientFlapConn.STATE_NOT_CONNECTED) {
//TODO: Do we need to catch these?
......
......@@ -29,6 +29,7 @@ import net.kano.joscar.snaccmd.CapabilityBlock;
import net.kano.joscar.ssiitem.BuddyItem;
import net.kano.joscar.ssiitem.GroupItem;
import org.jivesoftware.util.Log;
import org.jivesoftware.util.JiveGlobals;
import org.jivesoftware.wildfire.gateway.*;
import org.jivesoftware.wildfire.user.UserNotFoundException;
import org.jivesoftware.wildfire.roster.RosterItem;
......@@ -60,6 +61,7 @@ public class OSCARSession extends TransportSession {
*/
public OSCARSession(Registration registration, JID jid, OSCARTransport transport, Integer priority) {
super(registration, jid, transport, priority);
this.propertyPrefix = "plugin.gateway."+transport.getType().toString();
}
private BOSConnection bosConn = null;
......@@ -67,6 +69,7 @@ public class OSCARSession extends TransportSession {
private Set<ServiceConnection> services = new HashSet<ServiceConnection>();
private PresenceType presenceType = null;
private String verboseStatus = null;
private String propertyPrefix;
/**
* SSI tracking variables.
......@@ -79,7 +82,10 @@ public class OSCARSession extends TransportSession {
public void logIn(PresenceType presenceType, String verboseStatus) {
if (!isLoggedIn()) {
setLoginStatus(TransportLoginStatus.LOGGING_IN);
loginConn = new LoginConnection(new ConnDescriptor("login.oscar.aol.com", 5190), this);
loginConn = new LoginConnection(new ConnDescriptor(
JiveGlobals.getProperty(propertyPrefix+".connecthost", "login.oscar.aol.com"),
JiveGlobals.getIntProperty(propertyPrefix+".connectport", 5190)),
this);
loginConn.connect();
this.presenceType = presenceType;
......@@ -328,8 +334,11 @@ public class OSCARSession extends TransportSession {
}
void connectToService(int snacFamily, String host, ByteBlock cookie) {
ServiceConnection conn = new ServiceConnection(new ConnDescriptor(host, 5190), this,
cookie, snacFamily);
ServiceConnection conn = new ServiceConnection(new ConnDescriptor(host,
JiveGlobals.getIntProperty(propertyPrefix+".connectport", 5190)),
this,
cookie,
snacFamily);
conn.connect();
}
......
......@@ -11,6 +11,7 @@
package org.jivesoftware.wildfire.gateway.protocols.yahoo;
import org.jivesoftware.util.Log;
import org.jivesoftware.util.JiveGlobals;
import org.jivesoftware.wildfire.gateway.*;
import org.jivesoftware.wildfire.roster.RosterItem;
import org.jivesoftware.wildfire.user.UserNotFoundException;
......@@ -49,7 +50,10 @@ public class YahooSession extends TransportSession {
pseudoRoster = pseudoRosterManager.getPseudoRoster(registration);
yahooSession = new Session();
yahooSession = new Session(new DirectConnectionHandler(
JiveGlobals.getProperty("plugin.gateway.yahoo.connecthost", "scs.msg.yahoo.com"),
JiveGlobals.getIntProperty("plugin.gateway.yahoo.connectport", 5050)
));
yahooSession.addSessionListener(new YahooSessionListener(this));
}
......
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