Commit 6e92af10 authored by Daniel Henninger's avatar Daniel Henninger Committed by dhenninger

[GATE-74] Some work trying to get this XMPP/GTalk going. Something is amiss.

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@8035 b35dd754-fafc-0310-a699-88a17e54d16e
parent 064db555
...@@ -43,10 +43,13 @@ public class XMPPSession extends TransportSession { ...@@ -43,10 +43,13 @@ public class XMPPSession extends TransportSession {
super(registration, jid, transport, priority); super(registration, jid, transport, priority);
Log.debug("Creating "+getTransport().getType()+" session for " + registration.getUsername()); Log.debug("Creating "+getTransport().getType()+" session for " + registration.getUsername());
//XMPPConnection.DEBUG_ENABLED = true;
config = new ConnectionConfiguration( config = new ConnectionConfiguration(
JiveGlobals.getProperty("plugin.gateway."+getTransport().getType()+".connecthost", JiveGlobals.getProperty("plugin.gateway."+getTransport().getType()+".connecthost",
(getTransport().getType().equals(TransportType.gtalk) ? "talk.google.com" : "jabber.org")), (getTransport().getType().equals(TransportType.gtalk) ? "talk.google.com" : "jabber.org")),
JiveGlobals.getIntProperty("plugin.gateway."+getTransport().getType()+".connectport", 5222)); JiveGlobals.getIntProperty("plugin.gateway."+getTransport().getType()+".connectport", 5222),
new JID(registration.getUsername()).getDomain());
listener = new XMPPListener(this);
} }
/* /*
...@@ -66,19 +69,22 @@ public class XMPPSession extends TransportSession { ...@@ -66,19 +69,22 @@ public class XMPPSession extends TransportSession {
public void logIn(PresenceType presenceType, String verboseStatus) { public void logIn(PresenceType presenceType, String verboseStatus) {
if (!this.isLoggedIn()) { if (!this.isLoggedIn()) {
try {
listener = new XMPPListener(this);
setLoginStatus(TransportLoginStatus.LOGGING_IN); setLoginStatus(TransportLoginStatus.LOGGING_IN);
new Thread() {
public void run() {
try {
conn = new XMPPConnection(config); conn = new XMPPConnection(config);
conn.connect(); conn.connect();
conn.addConnectionListener(listener); conn.addConnectionListener(listener);
conn.login(this.getRegistration().getUsername(), this.getRegistration().getPassword(), "IMGateway"); conn.login(getRegistration().getUsername(), getRegistration().getPassword(), "IMGateway");
conn.getRoster().addRosterListener(listener); conn.getRoster().addRosterListener(listener);
conn.getChatManager().addChatListener(listener); conn.getChatManager().addChatListener(listener);
} }
catch (XMPPException e) { catch (XMPPException e) {
Log.error(getTransport().getType()+" user is not able to log in: "+this.getRegistration().getUsername(), e); Log.error(getTransport().getType()+" user is not able to log in: "+getRegistration().getUsername(), e);
}
} }
}.start();
} }
} }
......
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