Show
Ignore:
Timestamp:
11/09/07 20:30:15 (13 months ago)
Author:
asterix
Message:

merge some fixes from trunk: [8864] [8866] [8881] [8884] [8887] [8894] [8895] [8902] [8903] [8904] [8905] [8906] [8910] [8918] [8919] [8921] [8923] [8924] [8938] [8942] [8952] [8953] [8954]

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/gajim_0.11.2/src/gajim.py

    r8878 r8955  
    2424from common import i18n 
    2525 
     26# PyGTK2.10+ only throws a warning 
     27import warnings 
     28warnings.filterwarnings('error', module='gtk') 
     29try: 
     30        import gtk 
     31except Warning, msg: 
     32        if str(msg) == 'could not open display': 
     33                print >> sys.stderr, _('Gajim needs X server to run. Quiting...') 
     34                sys.exit() 
     35warnings.resetwarnings() 
     36 
    2637import message_control 
    2738 
     
    4152                pass 
    4253 
    43 try: 
    44         import gtk 
    45 except RuntimeError, msg: 
    46         if str(msg) == 'could not open display': 
    47                 print >> sys.stderr, _('Gajim needs X server to run. Quiting...') 
    48                 sys.exit() 
    4954pritext = '' 
    5055if gtk.pygtk_version < (2, 6, 0): 
     
    10211026                if self.msg_win_mgr.has_window(fjid, account): 
    10221027                        ctrl = self.msg_win_mgr.get_control(fjid, account) 
    1023                         contact = ctrl.contact 
    1024                         contact.show = show 
    1025                         contact.status = status 
    1026                         ctrl.update_ui() 
    1027                         uf_show = helpers.get_uf_show(show) 
    1028                         if status: 
    1029                                 ctrl.print_conversation(_('%s is now %s (%s)') % (nick, uf_show, 
    1030                                         status), 'status') 
     1028                        statusCode = array[9] 
     1029                        if '303' in statusCode: 
     1030                                new_nick = array[10] 
     1031                                ctrl.print_conversation(_('%s is now known as %s') % (nick, 
     1032                                        new_nick), 'status') 
     1033                                gc_c = gajim.contacts.get_gc_contact(account, room_jid, new_nick) 
     1034                                c = gajim.contacts.contact_from_gc_contact(gc_c) 
     1035                                ctrl.gc_contact = gc_c 
     1036                                ctrl.contact = c 
     1037                                ctrl.draw_banner() 
     1038                                old_jid = room_jid + '/' + nick 
     1039                                new_jid = room_jid + '/' + new_nick 
     1040                                self.msg_win_mgr.change_key(old_jid, new_jid, account) 
    10311041                        else: 
    1032                                 ctrl.print_conversation(_('%s is now %s') % (nick, uf_show), 
    1033                                         'status') 
    1034                         ctrl.parent_win.redraw_tab(ctrl) 
     1042                                contact = ctrl.contact 
     1043                                contact.show = show 
     1044                                contact.status = status 
     1045                                uf_show = helpers.get_uf_show(show) 
     1046                                if status: 
     1047                                        ctrl.print_conversation(_('%s is now %s (%s)') % (nick, uf_show, 
     1048                                                status), 'status') 
     1049                                else: 
     1050                                        ctrl.print_conversation(_('%s is now %s') % (nick, uf_show), 
     1051                                                'status') 
     1052                                ctrl.parent_win.redraw_tab(ctrl) 
     1053                                ctrl.update_ui() 
    10351054                        if self.remote_ctrl: 
    10361055                                self.remote_ctrl.raise_signal('GCPresence', (account, array))