Permalink
Browse files

added support for google apps on domains

Signed-off-by: Jay Parlar <parlar@gmail.com>
  • Loading branch information...
1 parent 472059a commit 2e2be4a1cf7c2256793dc98d5dfa5a5467a17330 Greg Allen committed with Aug 10, 2009
Showing with 5 additions and 3 deletions.
  1. +1 −1 emailnotify.py
  2. +4 −2 jabberbot.py
View
@@ -39,7 +39,7 @@ def __init__(self, username, password, apikey, labels = []):
self.got_first_response = False
self.last_id = self._id
self.last_query_time = time.time()
- super(EmailNotifyJabberBot, self).__init__(username, password)
+ super(EmailNotifyJabberBot, self).__init__(username, password, server = "talk.google.com", port = 5222)
self.user = User(username, apikey)
View
@@ -75,12 +75,14 @@ def unknown_command( self, mess, cmd, args):
class JabberBot(object):
command_prefix = 'bot_'
- def __init__( self, jid, password, res = None):
+ def __init__( self, jid, password, res = None, server = None, port = None):
"""Initializes the jabber bot and sets up commands."""
self.jid = xmpp.JID( jid)
self.password = password
self.res = (res or self.__class__.__name__)
self.conn = None
+ self.server = server
+ self.port = port
self.__finished = False
self.commands = { 'help': self.help_callback, }
@@ -96,7 +98,7 @@ def connect( self):
if not self.conn:
conn = xmpp.Client( self.jid.getDomain(), debug = [])
- if not conn.connect():
+ if not conn.connect([self.server, self.port]):
self.log( 'unable to connect to server.')
return None

0 comments on commit 2e2be4a

Please sign in to comment.