changeset 5b3ed346a6af in /home/hg/repos/gajim
details:http://hg.gajim.org/gajim?cmd=changeset;node=5b3ed346a6af description: Merge changes from default branch into osx_newbuildsys branch.
diffstat:
src/command_system/errors.py | 3 ++ src/command_system/implementation/standard.py | 29 +++++++++++++++++++++++++++ src/common/connection.py | 5 ++- src/common/connection_handlers.py | 2 - src/common/jingle_content.py | 4 ++- src/gui_interface.py | 8 +----- src/roster_window.py | 5 ++++ 7 files changed, 45 insertions(+), 11 deletions(-)
diffs (145 lines):
diff -r 91e62efdb6b8 -r 5b3ed346a6af src/command_system/errors.py --- a/src/command_system/errors.py Sat Dec 26 12:50:17 2009 +0100 +++ b/src/command_system/errors.py Sat Dec 26 12:51:40 2009 +0100 @@ -30,6 +30,9 @@
super(BaseError, self).__init__()
+ def __str__(self): + return self.message + class DefinitionError(BaseError): """ Used to indicate errors occured on command definition. diff -r 91e62efdb6b8 -r 5b3ed346a6af src/command_system/implementation/standard.py --- a/src/command_system/implementation/standard.py Sat Dec 26 12:50:17 2009 +0100 +++ b/src/command_system/implementation/standard.py Sat Dec 26 12:51:40 2009 +0100 @@ -128,6 +128,35 @@
self.echo(formatted)
+ @command(raw=True, empty=True) + @documentation(_(""" + Set current the status + + Status can be given as one of the following values: online, away, + chat, xa, dnd. + """)) + def status(self, status, message): + if status not in ('online', 'away', 'chat', 'xa', 'dnd'): + raise CommandError("Invalid status given") + for connection in gajim.connections.itervalues(): + connection.change_status(status, message) + + @command(raw=True, empty=True) + @documentation(_("Set the current status to away")) + def away(self, message): + if not message: + message = _("Away") + for connection in gajim.connections.itervalues(): + connection.change_status('away', message) + + @command('back', raw=True, empty=True) + @documentation(_("Set the current status to online")) + def online(self, message): + if not message: + message = _("Available") + for connection in gajim.connections.itervalues(): + connection.change_status('online', message) + class StandardChatCommands(CommandContainer): """ This command container contains standard command which are unique to a chat. diff -r 91e62efdb6b8 -r 5b3ed346a6af src/common/connection.py --- a/src/common/connection.py Sat Dec 26 12:50:17 2009 +0100 +++ b/src/common/connection.py Sat Dec 26 12:51:40 2009 +0100 @@ -1309,8 +1309,8 @@
def _on_xmpp_ping_answer(self, iq_obj): id_ = unicode(iq_obj.getAttr('id')) - if id_ == self.awaiting_xmpp_ping_id: - self.awaiting_xmpp_ping_id = None + assert id_ == self.awaiting_xmpp_ping_id + self.awaiting_xmpp_ping_id = None
def sendPing(self, pingTo=None): """ @@ -2226,6 +2226,7 @@ def check_pingalive(self): if self.awaiting_xmpp_ping_id: # We haven't got the pong in time, disco and reconnect + log.warn("No reply received for keepalive ping. Reconnecting.") self._disconnectedReconnCB()
def _reconnect_alarm(self): diff -r 91e62efdb6b8 -r 5b3ed346a6af src/common/connection_handlers.py --- a/src/common/connection_handlers.py Sat Dec 26 12:50:17 2009 +0100 +++ b/src/common/connection_handlers.py Sat Dec 26 12:51:40 2009 +0100 @@ -981,8 +981,6 @@ self.dispatch('ENTITY_TIME', (jid_stripped, resource, '')) self.entity_time_ids.remove(id_) return - if id_ == self.awaiting_xmpp_ping_id: - self.awaiting_xmpp_ping_id = None errmsg = iq_obj.getErrorMsg() errcode = iq_obj.getErrorCode() self.dispatch('ERROR_ANSWER', (id_, jid_from, errmsg, errcode)) diff -r 91e62efdb6b8 -r 5b3ed346a6af src/common/jingle_content.py --- a/src/common/jingle_content.py Sat Dec 26 12:50:17 2009 +0100 +++ b/src/common/jingle_content.py Sat Dec 26 12:51:40 2009 +0100 @@ -15,6 +15,8 @@ Handles Jingle contents (XEP 0166) """
+import xmpp + contents = {}
def get_jingle_content(node): @@ -131,4 +133,4 @@ self.callbacks = None del self.session.contents[(self.creator, self.name)]
-# vim: se ts=3: \ No newline at end of file +# vim: se ts=3: diff -r 91e62efdb6b8 -r 5b3ed346a6af src/gui_interface.py --- a/src/gui_interface.py Sat Dec 26 12:50:17 2009 +0100 +++ b/src/gui_interface.py Sat Dec 26 12:51:40 2009 +0100 @@ -2265,7 +2265,8 @@
w = ctrl.parent_win elif type_ in ('normal', 'file-request', 'file-request-error', - 'file-send-error', 'file-error', 'file-stopped', 'file-completed'): + 'file-send-error', 'file-error', 'file-stopped', 'file-completed', + 'jingle-incoming'): # Get the first single message event event = gajim.events.get_first_event(account, fjid, type_) if not event: @@ -2301,11 +2302,6 @@ self.show_unsubscribed_dialog(account, contact) gajim.events.remove_events(account, jid, event) self.roster.draw_contact(jid, account) - elif type_ == 'jingle-incoming': - event = gajim.events.get_first_event(account, jid, type_) - peerjid, sid, content_types = event.parameters - dialogs.VoIPCallReceivedDialog(account, peerjid, sid, content_types) - gajim.events.remove_events(account, jid, event) if w: w.set_active_tab(ctrl) w.window.window.focus(gtk.get_current_event_time()) diff -r 91e62efdb6b8 -r 5b3ed346a6af src/roster_window.py --- a/src/roster_window.py Sat Dec 26 12:50:17 2009 +0100 +++ b/src/roster_window.py Sat Dec 26 12:51:40 2009 +0100 @@ -1849,6 +1849,11 @@ gajim.interface.show_unsubscribed_dialog(account, data) gajim.events.remove_events(account, jid, event) return True + elif event.type_ == 'jingle-incoming': + peerjid, sid, content_types = data + dialogs.VoIPCallReceivedDialog(account, peerjid, sid, content_types) + gajim.events.remove_events(account, jid, event) + return True return False
################################################################################