Changeset 8561 for branches/jingle

Show
Ignore:
Timestamp:
08/24/07 16:36:53 (16 months ago)
Author:
liori
Message:

Jingle: systray

Location:
branches/jingle/src
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • branches/jingle/src/common/events.py

    r8275 r8561  
    2929                ''' type_ in chat, normal, file-request, file-error, file-completed, 
    3030                file-request-error, file-send-error, file-stopped, gc_msg, pm, 
    31                 printed_chat, printed_gc_msg, printed_marked_gc_msg, printed_pm 
     31                printed_chat, printed_gc_msg, printed_marked_gc_msg, printed_pm, 
     32                jingle-incoming 
    3233                parameters is (per type_): 
    3334                        chat, normal: [message, subject, kind, time, encrypted, resource, 
     
    3738                        gc_msg: None 
    3839                        printed_*: None 
    39                                 messages that are already printed in chat, but not read''' 
     40                                messages that are already printed in chat, but not read 
     41                        jingle-*: (fulljid, sessionid) ''' 
    4042                self.type_ = type_ 
    4143                self.time_ = time_ 
  • branches/jingle/src/gajim.py

    r8558 r8561  
    14891489                # We add it to the gajim.events queue 
    14901490                # Do we have a queue? 
    1491                 jid = gajim.get_jid_without_resource(jid) 
    1492                 no_queue = len(gajim.events.get_events(account, jid)) == 0 
     1491                barejid = gajim.get_jid_without_resource(jid) 
     1492                no_queue = len(gajim.events.get_events(account, barejid)) == 0 
    14931493                event_type = None 
    14941494                # type_ can be gc-invitation file-send-error file-error file-request-error 
    1495                 # file-request file-completed file-stopped 
     1495                # file-request file-completed file-stopped voip-incoming 
    14961496                # event_type can be in advancedNotificationWindow.events_list 
    14971497                event_types = {'file-request': 'ft_request', 
     
    14991499                if type_ in event_types: 
    15001500                        event_type = event_types[type_] 
    1501                 show_in_roster = notify.get_show_in_roster(event_type, account, jid) 
    1502                 show_in_systray = notify.get_show_in_systray(event_type, account, jid) 
     1501                show_in_roster = notify.get_show_in_roster(event_type, account, barejid) 
     1502                show_in_systray = notify.get_show_in_systray(event_type, account, barejid) 
    15031503                event = gajim.events.create_event(type_, event_args, 
    15041504                        show_in_roster = show_in_roster, 
    15051505                        show_in_systray = show_in_systray) 
    1506                 gajim.events.add_event(account, jid, event) 
     1506                gajim.events.add_event(account, barejid, event) 
    15071507 
    15081508                self.roster.show_title() 
    15091509                if no_queue: # We didn't have a queue: we change icons 
    1510                         if not gajim.contacts.get_contact_with_highest_priority(account, jid): 
     1510                        if not gajim.contacts.get_contact_with_highest_priority(account, barejid): 
    15111511                                # add contact to roster ("Not In The Roster") if he is not 
    1512                                 self.roster.add_to_not_in_the_roster(account, jid)  
    1513                         self.roster.draw_contact(jid, account) 
     1512                                self.roster.add_to_not_in_the_roster(account, barejid)  
     1513                        self.roster.draw_contact(barejid, account) 
    15141514 
    15151515                # Show contact in roster (if he is invisible for example) and select line 
    1516                 path = self.roster.get_path(jid, account)                
    1517                 self.roster.show_and_select_path(path, jid, account) 
     1516                path = self.roster.get_path(barejid, account)            
     1517                self.roster.show_and_select_path(path, barejid, account) 
    15181518 
    15191519        def remove_first_event(self, account, jid, type_ = None): 
     
    18861886                        dialogs.VoIPCallReceivedDialog(account, peerjid, sid) 
    18871887 
    1888                 # TODO: not checked 
    1889                 self.add_event(account, peerjid, 'jingle-session', (sid, contents)) 
    1890  
     1888                self.add_event(account, peerjid, 'voip-incoming', (peerjid, sid,)) 
     1889 
     1890                # TODO: check this too 
    18911891                if helpers.allow_showing_notification(account): 
    18921892                        # TODO: we should use another pixmap ;-) 
     
    18941894                                'ft_request.png') 
    18951895                        txt = _('%s wants to start a jingle session.') % gajim.get_name_from_jid( 
    1896                                 account, jid) 
     1896                                account, peerjid) 
    18971897                        path = gtkgui_helpers.get_path_to_generic_or_avatar(img) 
    18981898                        event_type = _('Jingle Session Request') 
    1899                         notify.popup(event_type, jid, account, 'jingle-request', 
     1899                        notify.popup(event_type, peerjid, account, 'jingle-request', 
    19001900                                path_to_image = path, title = event_type, text = txt) 
    19011901 
     
    23242324                        gajim.events.remove_events(account, jid, event) 
    23252325                        self.roster.draw_contact(jid, account) 
     2326                elif type_ == 'voip-incoming': 
     2327                        event = gajim.events.get_first_event(account, jid, type_) 
     2328                        peerjid, sid = event.parameters 
     2329                        dialogs.VoIPCallReceivedDialog(account, peerjid, sid) 
     2330                        gajim.events.remove_events(account, jid, event) 
    23262331                if w: 
    23272332                        w.set_active_tab(fjid, account)