Changeset 85

Show
Ignore:
Timestamp:
07/16/07 22:06:21 (3 years ago)
Author:
roidelapluie
Message:

add continue support

Location:
gajim/branches/chat2muc/src
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • gajim/branches/chat2muc/src/common/connection_handlers.py

    r11 r85  
    14481448                        if xtag.getNamespace() == common.xmpp.NS_CONFERENCE and not invite: 
    14491449                                room_jid = xtag.getAttr('jid') 
    1450                                 self.dispatch('GC_INVITATION', (room_jid, frm, '', None)) 
     1450                                is_continued = False 
     1451                                if xtag.getTag('continue'): 
     1452                                        is_continued = True 
     1453                                self.dispatch('GC_INVITATION', (room_jid, frm, '', None, 
     1454                                        is_continued)) 
    14511455                                return 
    14521456                # chatstates - look for chatstate tags in a message if not delayed 
     
    15241528                                item = invite.getTag('password') 
    15251529                                password = invite.getTagData('password') 
    1526                                 self.dispatch('GC_INVITATION',(frm, jid_from, reason, password)) 
     1530                                is_continued = False 
     1531                                if invite.getTag('continue'): 
     1532                                        is_continued = True 
     1533                                        print '1' 
     1534                                else: 
     1535                                        print '0' 
     1536                                self.dispatch('GC_INVITATION',(frm, jid_from, reason, password, 
     1537                                        is_continued)) 
    15271538                                return 
    15281539                        if self.name not in no_log_for and jid not in no_log_for and msgtxt: 
  • gajim/branches/chat2muc/src/dialogs.py

    r84 r85  
    25632563class InvitationReceivedDialog: 
    25642564        def __init__(self, account, room_jid, contact_jid, password = None, 
    2565         comment = None): 
     2565        comment = None, is_continued = False): 
    25662566 
    25672567                self.room_jid = room_jid 
    25682568                self.account = account 
     2569                self.is_continued = is_continued 
    25692570                xml = gtkgui_helpers.get_glade('invitation_received_dialog.glade') 
    25702571                self.dialog = xml.get_widget('invitation_received_dialog') 
    25712572 
    25722573                #Don't translate $Contact 
    2573                 pritext = _('$Contact has invited you to group chat %(room_jid)s')\ 
    2574                         % {'room_jid': room_jid} 
     2574                if is_continued: 
     2575                        pritext = _('$Contact has invited you to join a discussion') 
     2576                else: 
     2577                        pritext = _('$Contact has invited you to group chat %(room_jid)s')\ 
     2578                                % {'room_jid': room_jid} 
    25752579                contact = gajim.contacts.get_first_contact_from_jid(account, contact_jid) 
    25762580                if contact and contact.name: 
     
    26002604                self.dialog.destroy() 
    26012605                try: 
    2602                         JoinGroupchatWindow(self.account, self.room_jid) 
     2606                        if self.is_continued: 
     2607                                gajim.interface.roster.join_gc_room(self.account, self.room_jid, 
     2608                                        gajim.nicks[self.account], None, is_continued=True) 
     2609                        else: 
     2610                                JoinGroupchatWindow(self.account, self.room_jid) 
    26032611                except GajimGeneralException: 
    26042612                        pass 
  • gajim/branches/chat2muc/src/gajim.py

    r83 r85  
    12061206 
    12071207        def handle_event_gc_invitation(self, account, array): 
    1208                 #('GC_INVITATION', (room_jid, jid_from, reason, password)) 
     1208                #('GC_INVITATION', (room_jid, jid_from, reason, password, is_continued)) 
    12091209                jid = gajim.get_jid_without_resource(array[1]) 
    12101210                room_jid = array[0] 
    12111211                if helpers.allow_popup_window(account) or not self.systray_enabled: 
    12121212                        dialogs.InvitationReceivedDialog(account, room_jid, jid, array[3], 
    1213                                 array[2]) 
     1213                                array[2], is_continued=array[3]) 
    12141214                        return 
    12151215