summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sunshine/connection.py5
-rw-r--r--sunshine/contacts_info.py2
-rw-r--r--sunshine/handle.py2
-rwxr-xr-xtelepathy-sunshine3
4 files changed, 9 insertions, 3 deletions
diff --git a/sunshine/connection.py b/sunshine/connection.py
index 7ac119f..40175ee 100644
--- a/sunshine/connection.py
+++ b/sunshine/connection.py
@@ -57,6 +57,8 @@ from sunshine.util.decorator import async, stripHTML, unescape
__all__ = ['GaduClientFactory', 'SunshineConnection']
logger = logging.getLogger('Sunshine.Connection')
+observer = log.PythonLoggingObserver(loggerName='Sunshine.Connection')
+observer.start()
#SSL
ssl_support = False
@@ -450,8 +452,9 @@ class SunshineConnection(telepathy.server.Connection,
telepathy.CONNECTION_STATUS_REASON_AUTHENTICATION_FAILED)
reactor.stop()
- @async
+ #@async
def on_updateContact(self, contact):
+ #handle = SunshineHandleFactory(self, 'contact', str(contact.uin))
handle_id = self.get_handle_id_by_name(telepathy.constants.HANDLE_TYPE_CONTACT, str(contact.uin))
handle = self.handle(telepathy.constants.HANDLE_TYPE_CONTACT, handle_id)
logger.info("Status changed for UIN: %s, id: %s, status: %s, description: '%s'" % (contact.uin, handle.id, contact.status, contact.get_desc()))
diff --git a/sunshine/contacts_info.py b/sunshine/contacts_info.py
index d7e0060..68a65f4 100644
--- a/sunshine/contacts_info.py
+++ b/sunshine/contacts_info.py
@@ -26,7 +26,7 @@ import telepathy
import telepathy.constants
import telepathy.errors
-from twisted.internet.defer import Deferred
+from twisted.internet import defer
from sunshine.handle import SunshineHandleFactory
from sunshine.util.decorator import async
diff --git a/sunshine/handle.py b/sunshine/handle.py
index d26d442..23b994a 100644
--- a/sunshine/handle.py
+++ b/sunshine/handle.py
@@ -95,7 +95,7 @@ class SunshineSelfHandle(SunshineHandle):
class SunshineContactHandle(SunshineHandle):
#TODO: GG using just UIN to indenrify user so we need just contact_uin instead of contact_account and contact_network)
- def __init__(self, connection, id, contact_account, contact_network):
+ def __init__(self, connection, id, contact_account, contact_network=None):
handle_type = telepathy.HANDLE_TYPE_CONTACT
handle_name = str(contact_account)
self.account = str(contact_account)
diff --git a/telepathy-sunshine b/telepathy-sunshine
index 40d401d..d1dc536 100755
--- a/telepathy-sunshine
+++ b/telepathy-sunshine
@@ -6,6 +6,7 @@ import signal
import os
import sys
import logging
+from twisted.python import log
from twisted.internet import gtk2reactor
gtk2reactor.install()
@@ -30,6 +31,8 @@ from sunshine import SunshineDebug
from sunshine.util.decorator import async
logger = logging.getLogger('Sunshine')
+observer = log.PythonLoggingObserver(loggerName='Sunshine')
+observer.start()
IDLE_TIMEOUT = 5000
PROCESS_NAME = 'telepathy-sunshine'