Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src/server_plugin.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/server_plugin.py')
-rw-r--r--src/server_plugin.py21
1 files changed, 9 insertions, 12 deletions
diff --git a/src/server_plugin.py b/src/server_plugin.py
index e2dcc83..625f608 100644
--- a/src/server_plugin.py
+++ b/src/server_plugin.py
@@ -17,20 +17,16 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# Standard library
-import base64
import logging
-import os
from itertools import izip
-from string import hexdigits
import re
import gconf
# Other libraries
import dbus
-import gobject
-from telepathy.client import (ConnectionManager, Connection, Channel)
-from telepathy.interfaces import (CONN_MGR_INTERFACE, CONN_INTERFACE,
- CHANNEL_INTERFACE_GROUP, CHANNEL_TYPE_CONTACT_LIST)
+from telepathy.client import (Connection, Channel)
+from telepathy.interfaces import (CONN_INTERFACE, CHANNEL_INTERFACE_GROUP,
+ CHANNEL_TYPE_CONTACT_LIST)
from telepathy.constants import (HANDLE_TYPE_CONTACT, HANDLE_TYPE_GROUP,
CONNECTION_STATUS_CONNECTED, CONNECTION_STATUS_DISCONNECTED,
CHANNEL_GROUP_FLAG_CHANNEL_SPECIFIC_HANDLES,
@@ -41,10 +37,10 @@ import psutils
from telepathy_plugin import TelepathyPlugin
-
_logger = logging.getLogger('s-p-s.server_plugin')
_MUC_JID_RE = re.compile('.*@.*/.*')
+hexdigits = '0123456789abcdefABCDEF'
class ServerPlugin(TelepathyPlugin):
"""Telepathy-python-based presence server interface
@@ -276,7 +272,7 @@ class ServerPlugin(TelepathyPlugin):
HANDLE_TYPE_CONTACT, handles)
for handle, jid in izip(handles, identifiers):
- user, host = jid.split('@', 1)
+ host = jid.split('@', 1)[1]
if self._server_is_trusted(host):
result.append(handle)
@@ -319,7 +315,8 @@ class ServerPlugin(TelepathyPlugin):
if status == CONNECTION_STATUS_DISCONNECTED:
if reason == CONNECTION_STATUS_REASON_AUTHENTICATION_FAILED and \
not self._account['register']:
- _logger.debug('Authentication failed. Trying to register the account')
+ _logger.debug(
+ 'Authentication failed. Trying to register the account')
self._account['register'] = True
self._stop()
self._init_connection()
@@ -376,9 +373,9 @@ class ServerPlugin(TelepathyPlugin):
friends_handles = set()
friends = set()
for key in keys:
- id = psutils.pubkey_to_keyid(key)
+ identity = psutils.pubkey_to_keyid(key)
# this assumes that all our friends are on the same server as us
- jid = '%s@%s' % (id, server)
+ jid = '%s@%s' % (identity, server)
friends.add(jid)
def error_syncing_friends(e):