~ubuntu-branches/ubuntu/karmic/gajim/karmic

« back to all changes in this revision

Viewing changes to src/common/connection_handlers.py

  • Committer: Bazaar Package Importer
  • Author(s): Nafallo Bjälevik
  • Date: 2008-12-17 12:08:19 UTC
  • mfrom: (1.1.11 upstream)
  • Revision ID: james.westby@ubuntu.com-20081217120819-20o3ibfc8fc1r1vk
Tags: 0.12-0ubuntu1
* New upstream release:
  + Fix text rendering in notifications
  + Better sessions support
  + Better auto-away support
  + Fix banshee support
  + Quodlibet support
  + Fix GSSAPI authentification
  + Those translations have been temporarily removed because they are outdated:
    Breton (br), Greek (el), Dutch (nl), Portugese (pt). 
* debian/control:
  - Added python-kerberos (>= 1.1) to Recommends for the GSSAPI auth.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1297
1297
                except KeyError:
1298
1298
                        return None
1299
1299
 
1300
 
        def terminate_sessions(self):
 
1300
        def terminate_sessions(self, send_termination = False):
1301
1301
                '''send termination messages and delete all active sessions'''
1302
1302
                for jid in self.sessions:
1303
1303
                        for thread_id in self.sessions[jid]:
1304
 
                                self.sessions[jid][thread_id].terminate()
 
1304
                                self.sessions[jid][thread_id].terminate(send_termination)
1305
1305
 
1306
1306
                self.sessions = {}
1307
1307
 
1579
1579
                        return
1580
1580
                iq_obj = iq_obj.buildReply('result')
1581
1581
                qp = iq_obj.getTag('query')
1582
 
                qp.setTagData('utc', strftime('%Y%m%dT%T', gmtime()))
 
1582
                qp.setTagData('utc', strftime('%Y%m%dT%H:%M:%S', gmtime()))
1583
1583
                qp.setTagData('tz', helpers.decode_string(tzname[daylight]))
1584
1584
                qp.setTagData('display', helpers.decode_string(strftime('%c',
1585
1585
                        localtime())))
1593
1593
                iq_obj = iq_obj.buildReply('result')
1594
1594
                qp = iq_obj.setTag('time',
1595
1595
                        namespace=common.xmpp.NS_TIME_REVISED)
1596
 
                qp.setTagData('utc', strftime('%Y-%m-%dT%TZ', gmtime()))
 
1596
                qp.setTagData('utc', strftime('%Y-%m-%dT%H:%M:%SZ', gmtime()))
1597
1597
                zone = -(timezone, altzone)[daylight] / 60
1598
1598
                tzo = (zone / 60, abs(zone % 60))
1599
1599
                qp.setTagData('tzo', '%+03d:%02d' % (tzo))
2008
2008
 
2009
2009
                status = prs.getStatus() or ''
2010
2010
                show = prs.getShow()
2011
 
                if not show in STATUS_LIST:
 
2011
                if not show in ['away', 'chat', 'dnd', 'xa']:
2012
2012
                        show = '' # We ignore unknown show
2013
2013
                if not ptype and not show:
2014
2014
                        show = 'online'
2179
2179
                                keyID, timestamp, None))
2180
2180
 
2181
2181
                if ptype == 'unavailable' and jid_stripped in self.sessions:
2182
 
                        # automatically terminate sessions that they haven't sent a thread ID in
 
2182
                        # automatically terminate sessions that they haven't sent a thread ID
 
2183
                        # in, only if other part support thread ID
2183
2184
                        for sess in self.sessions[jid_stripped].values():
2184
2185
                                if not sess.received_thread_id:
2185
 
                                        sess.terminate()
2186
 
                                        del self.sessions[jid_stripped][sess.thread_id]
 
2186
                                        contact = gajim.contacts.get_contact(self.name, jid_stripped)
 
2187
 
 
2188
                                        session_supported = gajim.capscache.is_supported(contact,
 
2189
                                                common.xmpp.NS_SSN) or gajim.capscache.is_supported(contact,
 
2190
                                                common.xmpp.NS_ESESSION)
 
2191
                                        if session_supported:
 
2192
                                                sess.terminate()
 
2193
                                                del self.sessions[jid_stripped][sess.thread_id]
2187
2194
 
2188
2195
                if avatar_sha is not None and ptype != 'error':
2189
2196
                        if jid_stripped not in self.vcard_shas: