Merge branch 'master' of git+ssh://dev.laptop.org/git/sugar
This commit is contained in:
commit
8c928f05b8
@ -115,6 +115,7 @@ class Activity(dbus.service.Object):
|
|||||||
def join(self):
|
def join(self):
|
||||||
if not self._joined:
|
if not self._joined:
|
||||||
self._activity_text_channel = self._tp.join_activity(self._activity_id)
|
self._activity_text_channel = self._tp.join_activity(self._activity_id)
|
||||||
|
self._activity_text_channel[CHANNEL_INTERFACE].connect_to_signal('Closed', self._activity_text_channel_closed_cb)
|
||||||
self._joined = True
|
self._joined = True
|
||||||
|
|
||||||
def get_channels(self):
|
def get_channels(self):
|
||||||
@ -125,4 +126,7 @@ class Activity(dbus.service.Object):
|
|||||||
def leave(self):
|
def leave(self):
|
||||||
if self._joined:
|
if self._joined:
|
||||||
self._activity_text_channel[CHANNEL_INTERFACE].Close()
|
self._activity_text_channel[CHANNEL_INTERFACE].Close()
|
||||||
|
|
||||||
|
def _activity_text_channel_closed_cb(self):
|
||||||
self._joined = False
|
self._joined = False
|
||||||
|
self._activity_text_channel = None
|
||||||
|
@ -229,6 +229,9 @@ class ServerPlugin(gobject.GObject):
|
|||||||
|
|
||||||
def _upload_avatar(self):
|
def _upload_avatar(self):
|
||||||
icon = os.path.join(env.get_profile_path(), "buddy-icon.jpg")
|
icon = os.path.join(env.get_profile_path(), "buddy-icon.jpg")
|
||||||
|
if not os.path.exists(icon):
|
||||||
|
return
|
||||||
|
|
||||||
md5 = hashlib.md5()
|
md5 = hashlib.md5()
|
||||||
md5.update(open(icon).read())
|
md5.update(open(icon).read())
|
||||||
hash = md5.hexdigest()
|
hash = md5.hexdigest()
|
||||||
@ -378,7 +381,8 @@ class ServerPlugin(gobject.GObject):
|
|||||||
timestamp, statuses = presence[handle]
|
timestamp, statuses = presence[handle]
|
||||||
online = handle in self._online_contacts
|
online = handle in self._online_contacts
|
||||||
for status, params in statuses.items():
|
for status, params in statuses.items():
|
||||||
print "Handle %s now online=%s with status %s" % (handle, online, status)
|
jid = self._conn[CONN_INTERFACE].InspectHandles(CONNECTION_HANDLE_TYPE_CONTACT, [handle])[0]
|
||||||
|
print "Handle %s (%s) was online=%s. new statuse %s" % (handle, jid, online, status)
|
||||||
if not online and status in ["available", "away", "brb", "busy", "dnd", "xa"]:
|
if not online and status in ["available", "away", "brb", "busy", "dnd", "xa"]:
|
||||||
try:
|
try:
|
||||||
self._contact_online(handle)
|
self._contact_online(handle)
|
||||||
|
Loading…
Reference in New Issue
Block a user