gajim.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2026
October
September
August
July
June
May
April
March
February
January
2025
December
November
October
September
August
July
June
May
April
March
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
List overview
Download
Commits
September 2010
----- 2026 -----
October 2026
September 2026
August 2026
July 2026
June 2026
May 2026
April 2026
March 2026
February 2026
January 2026
----- 2025 -----
December 2025
November 2025
October 2025
September 2025
August 2025
July 2025
June 2025
May 2025
April 2025
March 2025
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
commits@gajim.org
5 participants
70 discussions
Start a n
N
ew thread
gajim: [Zhihao Yuan & I] use convert is dvipng doesn't work. Fix...
by Yann Leboulanger
24 Sep '10
24 Sep '10
changeset c821dd3af25f in /home/hg/repos/gajim
details:http://hg.gajim.org/gajim?cmd=changeset;node=c821dd3af25f
description: [Zhihao Yuan & I] use convert is dvipng doesn't work. Fixes #5935 diffstat: src/common/latex.py | 25 +++++++++++++++++-------- src/features_window.py | 4 ++-- src/gui_interface.py | 13 +++++++++++++ 3 files changed, 32 insertions(+), 10 deletions(-) diffs (79 lines): diff -r e81ceeabe85a -r c821dd3af25f src/common/latex.py --- a/src/common/latex.py Fri Sep 24 19:53:25 2010 +0200 +++ b/src/common/latex.py Fri Sep 24 23:15:21 2010 +0200 @@ -115,11 +115,16 @@ result = None exitcode = 0 - try: - bg_str, fg_str = gajim.interface.get_bg_fg_colors() - except: - # interface may not be available when we test latext at startup - bg_str, fg_str = 'rgb 1.0 1.0 1.0', 'rgb 0.0 0.0 0.0' + def fg_str(fmt): + try: + return [{'hex' : '+level-colors', 'tex' : '-fg'}[fmt], + gajim.interface.get_fg_color(fmt)] + except KeyError: + # interface may not be available when we test latex at startup + return [] + except AttributeError: + # interface may not be available when we test latext at startup + return ['-fg', 'rgb 0.0 0.0 0.0'] # filter latex code with bad commands if check_blacklist(str_): @@ -138,9 +143,13 @@ if exitcode == 0: # convert dvi to png latex_png_dpi = gajim.config.get('latex_png_dpi') - exitcode = try_run(['dvipng', '-bg', bg_str, '-fg', fg_str, '-T', - 'tight', '-D', latex_png_dpi, tmpfile + '.dvi', '-o', - tmpfile + '.png']) + exitcode = try_run(['dvipng'] + fg_str('tex') + ['-T', 'tight', '-D', + latex_png_dpi, tmpfile + '.dvi', '-o', tmpfile + '.png']) + + if exitcode: + # dvipng failed, try convert + exitcode = try_run(['convert'] + fg_str('hex') + ['-trim', + '-density', latex_png_dpi, tmpfile + '.dvi', tmpfile + '.png']) # remove temp files created by us and TeX extensions = ['.tex', '.log', '.aux', '.dvi'] diff -r e81ceeabe85a -r c821dd3af25f src/features_window.py --- a/src/features_window.py Fri Sep 24 19:53:25 2010 +0200 +++ b/src/features_window.py Fri Sep 24 23:15:21 2010 +0200 @@ -92,8 +92,8 @@ _('Requires python2.5.')), _('LaTeX'): (self.latex_available, _('Transform LaTeX expressions between $$ $$.'), - _('Requires texlive-latex-base and dvipng. You have to set \'use_latex\' to True in the Advanced Configuration Editor.'), - _('Requires texlive-latex-base and dvipng (All is in MikTeX). You have to set \'use_latex\' to True in the Advanced Configuration Editor.')), + _('Requires texlive-latex-base and (dvipng or ImageMagick). You have to set \'use_latex\' to True in the Advanced Configuration Editor.'), + _('Requires texlive-latex-base and (dvipng or ImageMagick) (All is in MikTeX). You have to set \'use_latex\' to True in the Advanced Configuration Editor.')), _('End to End message encryption'): (self.pycrypto_available, _('Encrypting chat messages.'), _('Requires python-crypto.'), diff -r e81ceeabe85a -r c821dd3af25f src/gui_interface.py --- a/src/gui_interface.py Fri Sep 24 19:53:25 2010 +0200 +++ b/src/gui_interface.py Fri Sep 24 23:15:21 2010 +0200 @@ -2704,6 +2704,19 @@ fg_str = format_gdkcolor(style.text[gtk.STATE_NORMAL]) return (bg_str, fg_str) + def get_fg_color(self, fmt='hex'): + def format_gdkcolor (c): + if fmt == 'tex': + return ' '.join([str(s) for s in + ('rgb', c.red_float, c.green_float, c.blue_float)]) + elif fmt == 'hex': + return str(c) + + # get foreground style color and create string + dummy = gtk.Invisible() + dummy.ensure_style() + return format_gdkcolor(dummy.get_style().text[gtk.STATE_NORMAL]) + def read_sleepy(self): """ Check idle status and change that status if needed
1
0
0
0
gajim: fix some var name
by Yann Leboulanger
24 Sep '10
24 Sep '10
changeset e81ceeabe85a in /home/hg/repos/gajim
details:http://hg.gajim.org/gajim?cmd=changeset;node=e81ceeabe85a
description: fix some var name diffstat: src/common/connection_handlers_events.py | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diffs (23 lines): diff -r ef7b825a58cd -r e81ceeabe85a src/common/connection_handlers_events.py --- a/src/common/connection_handlers_events.py Fri Sep 24 19:27:08 2010 +0200 +++ b/src/common/connection_handlers_events.py Fri Sep 24 19:53:25 2010 +0200 @@ -831,14 +831,14 @@ if self.ptype == 'subscribe': log.debug('subscribe request from %s' % self.jfid) if self.fjid.find('@') <= 0 and self.fjid in \ - self.agent_registrations: - self.agent_registrations[self.fjid]['sub_received'] = True - if not self.agent_registrations[self.fjid]['roster_push']: + self.conn.agent_registrations: + self.conn.agent_registrations[self.fjid]['sub_received'] = True + if not self.conn.agent_registrations[self.fjid]['roster_push']: # We'll reply after roster push result return if gajim.config.get_per('accounts', self.conn.name, 'autoauth') or \ - self.fjid.find('@') <= 0 or self.jid in self.jids_for_auto_auth or \ - transport_auto_auth: + self.fjid.find('@') <= 0 or self.jid in \ + self.conn.jids_for_auto_auth or transport_auto_auth: if self.conn.connection: p = xmpp.Presence(self.fjid, 'subscribed') p = self.conn.add_sha(p)
1
0
0
0
gajim: fix presence event handling. Fixes #5936
by Yann Leboulanger
24 Sep '10
24 Sep '10
changeset ef7b825a58cd in /home/hg/repos/gajim
details:http://hg.gajim.org/gajim?cmd=changeset;node=ef7b825a58cd
description: fix presence event handling. Fixes #5936 diffstat: src/common/connection_handlers.py | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diffs (12 lines): diff -r 7a93095f421b -r ef7b825a58cd src/common/connection_handlers.py --- a/src/common/connection_handlers.py Fri Sep 24 19:25:04 2010 +0200 +++ b/src/common/connection_handlers.py Fri Sep 24 19:27:08 2010 +0200 @@ -1747,6 +1747,8 @@ def _nec_presence_received(self, obj): account = obj.conn.name + if account != self.name: + return jid = obj.jid resource = obj.resource or ''
1
0
0
0
gajim: add Deutsche Telekom Root CA 2 vert. Fixes #5937
by Yann Leboulanger
24 Sep '10
24 Sep '10
changeset 7a93095f421b in /home/hg/repos/gajim
details:http://hg.gajim.org/gajim?cmd=changeset;node=7a93095f421b
description: add Deutsche Telekom Root CA 2 vert. Fixes #5937 diffstat: data/other/cacerts.pem | 23 +++++++++++++++++++++++ 1 files changed, 23 insertions(+), 0 deletions(-) diffs (30 lines): diff -r e892c0bbdcf2 -r 7a93095f421b data/other/cacerts.pem --- a/data/other/cacerts.pem Thu Sep 23 22:17:43 2010 +0200 +++ b/data/other/cacerts.pem Fri Sep 24 19:25:04 2010 +0200 @@ -2552,3 +2552,26 @@ um0ABj6y6koQOdjQK/W/7HW/lwLFCRsI3FU34oH7N4RDYiDK51ZLZer+bMEkkySh NOsF/5oirpt9P/FlUQqmMGqz9IgcgA38corog14= -----END CERTIFICATE----- +Deutsche Telekom Root CA 2 +-----BEGIN CERTIFICATE----- +MIIDnzCCAoegAwIBAgIBJjANBgkqhkiG9w0BAQUFADBxMQswCQYDVQQGEwJERTEc +MBoGA1UEChMTRGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0GA1UECxMWVC1UZWxlU2Vj +IFRydXN0IENlbnRlcjEjMCEGA1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBSb290IENB +IDIwHhcNOTkwNzA5MTIxMTAwWhcNMTkwNzA5MjM1OTAwWjBxMQswCQYDVQQGEwJE +RTEcMBoGA1UEChMTRGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0GA1UECxMWVC1UZWxl +U2VjIFRydXN0IENlbnRlcjEjMCEGA1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBSb290 +IENBIDIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCrC6M14IspFLEU +ha88EOQ5bzVdSq7d6mGNlUn0b2SjGmBmpKlAIoTZ1KXleJMOaAGtuU1cOs7TuKhC +QN/Po7qCWWqSG6wcmtoIKyUn+WkjR/Hg6yx6m/UTAtB+NHzCnjwAWav12gz1Mjwr +rFDa1sPeg5TKqAyZMg4ISFZbavva4VhYAUlfckE8FQYBjl2tqriTtM2e66foai1S +NNs671x1Udrb8zH57nGYMsRUFUQM+ZtV7a3fGAigo4aKSe5TBY8ZTNXeWHmb0moc +QqvF1afPaA+W5OFhmHZhyJF81j4A4pFQh+GdCuatl9Idxjp9y7zaAzTVjlsB9WoH +txa2bkp/AgMBAAGjQjBAMB0GA1UdDgQWBBQxw3kbuvVT1xfgiXotF2wKsyudMzAP +BgNVHRMECDAGAQH/AgEFMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOC +AQEAlGRZrTlk5ynrE/5aw4sTV8gEJPB0d8Bg42f76Ymmg7+Wgnxu1MM9756Abrsp +tJh6sTtU6zkXR34ajgv8HzFZMQSyzhfzLMdiNlXiItiJVbSYSKpk+tYcNthEeFpa +IzpXl/V6ME+un2pMSyuOoAPjPuCp1NJ70rOo4nI8rZ7/gFnkm0W09juwzTkZmDLl +6iFhkOQxIY40sfcvNUqFENrnijchvllj4PKFiDFT1FQUhXB59C4Gdyd1Lx+4ivn+ +xbrYNuSD7Odlt79jWvNGr4GUN9RBjNYj1h7P9WgbRGOiWrqnNVmh5XAFmw4jV5mU +Cm26OWMohpLzGITY+9HPBVZkVw== +-----END CERTIFICATE-----
1
0
0
0
gajim: fix var name. Fixes #5934
by Yann Leboulanger
23 Sep '10
23 Sep '10
changeset e892c0bbdcf2 in /home/hg/repos/gajim
details:http://hg.gajim.org/gajim?cmd=changeset;node=e892c0bbdcf2
description: fix var name. Fixes #5934 diffstat: src/gui_interface.py | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diffs (12 lines): diff -r 2b03ab714d38 -r e892c0bbdcf2 src/gui_interface.py --- a/src/gui_interface.py Thu Sep 23 21:43:07 2010 +0200 +++ b/src/gui_interface.py Thu Sep 23 22:17:43 2010 +0200 @@ -340,7 +340,7 @@ if c_.show not in ('offline', 'error'): obj.show_notif = False break - if show_notif: + if obj.show_notif: if obj.old_show < 2 and obj.new_show > 1: notify.notify('contact_connected', jid, account, status)
1
0
0
0
gajim: merge presence handling modifications changes
by Yann Leboulanger
23 Sep '10
23 Sep '10
changeset 2b03ab714d38 in /home/hg/repos/gajim
details:http://hg.gajim.org/gajim?cmd=changeset;node=2b03ab714d38
description: merge presence handling modifications changes diffstat: data/gui/chat_control.ui | 18 + data/gui/groupchat_control.ui | 14 + plugins/Makefile.am | 2 +- plugins/acronyms_expander.py | 102 ---------- plugins/acronyms_expander/__init__.py | 1 + plugins/acronyms_expander/acronyms_expander.py | 96 +++++++++ plugins/acronyms_expander/manifest.ini | 9 + plugins/banner_tweaks/manifest.ini | 10 + plugins/banner_tweaks/plugin.py | 9 - plugins/dbus_plugin/manifest.ini | 10 + plugins/dbus_plugin/plugin.py | 7 - plugins/events_dump/manifest.ini | 8 + plugins/events_dump/plugin.py | 6 - plugins/google_translation/manifest.ini | 8 + plugins/google_translation/plugin.py | 6 - plugins/length_notifier/length_notifier.py | 6 - plugins/length_notifier/manifest.ini | 9 + plugins/new_events_example/manifest.ini | 11 + plugins/new_events_example/plugin.py | 6 - plugins/roster_buttons/manifest.ini | 10 + plugins/roster_buttons/plugin.py | 6 - plugins/snarl_notifications/manifest.ini | 11 + plugins/snarl_notifications/plugin.py | 7 - src/common/connection_handlers.py | 3 - src/common/connection_handlers_events.py | 3 - src/common/jingle_rtp.py | 3 + src/config.py | 2 - src/dialogs.py | 9 +- src/groupchat_control.py | 2 - src/plugins/gui.py | 29 +- src/plugins/pluginmanager.py | 252 +++++++++++++----------- src/statusicon.py | 6 +- 32 files changed, 386 insertions(+), 295 deletions(-) diffs (truncated from 1286 to 300 lines): diff -r ce68139c3179 -r 2b03ab714d38 data/gui/chat_control.ui --- a/data/gui/chat_control.ui Thu Sep 23 20:46:47 2010 +0200 +++ b/data/gui/chat_control.ui Thu Sep 23 21:43:07 2010 +0200 @@ -270,6 +270,8 @@ <property name="can_focus">True</property> <property name="receives_default">True</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="has_tooltip">True</property> + <property name="tooltip_text" translatable="yes">Show a list of emoticons (Alt+M)</property> <property name="relief">none</property> <property name="focus_on_click">False</property> <child> @@ -292,6 +294,8 @@ <property name="can_focus">True</property> <property name="receives_default">True</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="has_tooltip">True</property> + <property name="tooltip_text" translatable="yes">Show a list of formattings</property> <property name="relief">none</property> <property name="focus_on_click">False</property> <child> @@ -324,6 +328,8 @@ <property name="receives_default">True</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> <property name="no_show_all">True</property> + <property name="has_tooltip">True</property> + <property name="tooltip_text" translatable="yes">Add this contact to roster (Ctrl+D)</property> <property name="relief">none</property> <child> <object class="GtkImage" id="image9"> @@ -365,6 +371,8 @@ <object class="GtkToggleButton" id="audio_togglebutton"> <property name="can_focus">True</property> <property name="receives_default">True</property> + <property name="has_tooltip">True</property> + <property name="tooltip_text" translatable="yes">Toggle audio session</property> <property name="relief">none</property> <child> <object class="GtkImage" id="audio_image"> @@ -383,6 +391,8 @@ <object class="GtkToggleButton" id="video_togglebutton"> <property name="can_focus">True</property> <property name="receives_default">True</property> + <property name="has_tooltip">True</property> + <property name="tooltip_text" translatable="yes">Toggle video session</property> <property name="relief">none</property> <child> <object class="GtkImage" id="video_image"> @@ -403,6 +413,8 @@ <property name="can_focus">True</property> <property name="receives_default">True</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="has_tooltip">True</property> + <property name="tooltip_text" translatable="yes">Invite contacts to the conversation (Ctrl+G)</property> <property name="relief">none</property> <property name="focus_on_click">False</property> <child> @@ -425,6 +437,8 @@ <property name="can_focus">True</property> <property name="receives_default">True</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="has_tooltip">True</property> + <property name="tooltip_text" translatable="yes">Show the contact's profile (Ctrl+I)</property> <property name="relief">none</property> <property name="focus_on_click">False</property> <child> @@ -447,6 +461,8 @@ <property name="can_focus">True</property> <property name="receives_default">True</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="has_tooltip">True</property> + <property name="tooltip_text" translatable="yes">Browse the chat history (Ctrl+H)</property> <property name="relief">none</property> <property name="focus_on_click">False</property> <child> @@ -480,6 +496,8 @@ <property name="can_focus">True</property> <property name="receives_default">True</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="has_tooltip">True</property> + <property name="tooltip_text" translatable="yes">Show a menu of advanced functions (Alt+D)</property> <property name="relief">none</property> <property name="focus_on_click">False</property> <child> diff -r ce68139c3179 -r 2b03ab714d38 data/gui/groupchat_control.ui --- a/data/gui/groupchat_control.ui Thu Sep 23 20:46:47 2010 +0200 +++ b/data/gui/groupchat_control.ui Thu Sep 23 21:43:07 2010 +0200 @@ -166,6 +166,8 @@ <property name="can_focus">True</property> <property name="receives_default">True</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="has_tooltip">True</property> + <property name="tooltip_text" translatable="yes">Show a list of emoticons (Alt+M)</property> <property name="relief">none</property> <child> <object class="GtkImage" id="emoticons_button_image"> @@ -193,6 +195,8 @@ <property name="can_focus">True</property> <property name="receives_default">True</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="has_tooltip">True</property> + <property name="tooltip_text" translatable="yes">Show a list of formattings</property> <property name="relief">none</property> <property name="focus_on_click">False</property> <child> @@ -224,6 +228,8 @@ <property name="can_focus">True</property> <property name="receives_default">True</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="has_tooltip">True</property> + <property name="tooltip_text" translatable="yes">Change your nickname (Ctrl+N)</property> <property name="relief">none</property> <child> <object class="GtkImage" id="image4"> @@ -246,6 +252,8 @@ <property name="can_focus">True</property> <property name="receives_default">True</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="has_tooltip">True</property> + <property name="tooltip_text" translatable="yes">Change the room's subject (Alt+T)</property> <property name="relief">none</property> <child> <object class="GtkImage" id="image6"> @@ -269,6 +277,8 @@ <property name="receives_default">True</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> <property name="no_show_all">True</property> + <property name="has_tooltip">True</property> + <property name="tooltip_text" translatable="yes">Bookmark this room (Ctrl+B)</property> <property name="relief">none</property> <child> <object class="GtkImage" id="image7"> @@ -291,6 +301,8 @@ <property name="can_focus">True</property> <property name="receives_default">True</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="has_tooltip">True</property> + <property name="tooltip_text" translatable="yes">Browse the chat history (Ctrl+H)</property> <property name="relief">none</property> <child> <object class="GtkImage" id="image8"> @@ -323,6 +335,8 @@ <property name="can_focus">True</property> <property name="receives_default">True</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="has_tooltip">True</property> + <property name="tooltip_text" translatable="yes">Show a menu of advanced functions (Alt+D)</property> <property name="relief">none</property> <property name="focus_on_click">False</property> <child> diff -r ce68139c3179 -r 2b03ab714d38 plugins/Makefile.am --- a/plugins/Makefile.am Thu Sep 23 20:46:47 2010 +0200 +++ b/plugins/Makefile.am Thu Sep 23 21:43:07 2010 +0200 @@ -3,8 +3,8 @@ gajimpluginsdir = $(gajim_pluginsdir) nobase_dist_gajimplugins_PYTHON = \ - $(srcdir)/*.py \ $(srcdir)/*/*.py \ + $(srcdir)/*/manifest.ini \ $(srcdir)/*/*.ui MAINTAINERCLEANFILES = Makefile.in diff -r ce68139c3179 -r 2b03ab714d38 plugins/acronyms_expander.py --- a/plugins/acronyms_expander.py Thu Sep 23 20:46:47 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,102 +0,0 @@ -# -*- coding: utf-8 -*- - -## This file is part of Gajim. -## -## Gajim is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published -## by the Free Software Foundation; version 3 only. -## -## Gajim is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with Gajim. If not, see <
http://www.gnu.org/licenses/
>. -## - -''' -Acronyms expander plugin. - -:author: Mateusz Biliński <mateusz(a)bilinski.it> -:since: 9th June 2008 -:copyright: Copyright (2008) Mateusz Biliński <mateusz(a)bilinski.it> -:license: GPL -''' - -import sys - -import gtk -import gobject - -from plugins import GajimPlugin -from plugins.helpers import log, log_calls - -class AcronymsExpanderPlugin(GajimPlugin): - name = u'Acronyms Expander' - short_name = u'acronyms_expander' - version = u'0.1' - description = u'''Replaces acronyms (or other strings) with given expansions/substitutes.''' - authors = [u'Mateusz Biliński <mateusz(a)bilinski.it>'] - homepage = u'
http://blog.bilinski.it
' - - @log_calls('AcronymsExpanderPlugin') - def init(self): - self.config_dialog = None - - self.gui_extension_points = { - 'chat_control_base': (self.connect_with_chat_control_base, - self.disconnect_from_chat_control_base) - } - - self.config_default_values = { - 'INVOKER': (' ', _('')), - 'ACRONYMS': ({'RTFM': 'Read The Friendly Manual', - '/slap': '/me slaps', - 'PS-': 'plug-in system', - 'G-': 'Gajim', - 'GNT-': '
http://trac.gajim.org/newticket
', - 'GW-': '
http://trac.gajim.org/
', - 'GTS-': '
http://trac.gajim.org/report
', - }, - _('')), - } - - @log_calls('AcronymsExpanderPlugin') - def textbuffer_live_acronym_expander(self, tb): - """ - @param tb gtk.TextBuffer - """ - #assert isinstance(tb,gtk.TextBuffer) - ACRONYMS = self.config['ACRONYMS'] - INVOKER = self.config['INVOKER'] - t = tb.get_text(tb.get_start_iter(), tb.get_end_iter()) - #log.debug('%s %d'%(t, len(t))) - if t and t[-1] == INVOKER: - #log.debug('changing msg text') - base, sep, head=t[:-1].rpartition(INVOKER) - log.debug('%s | %s | %s'%(base, sep, head)) - if head in ACRONYMS: - head = ACRONYMS[head] - #log.debug('head: %s'%(head)) - t = ''.join((base, sep, head, INVOKER)) - #log.debug("setting text: '%s'"%(t)) - gobject.idle_add(tb.set_text, t) - - @log_calls('AcronymsExpanderPlugin') - def connect_with_chat_control_base(self, chat_control): - d = {} - tv = chat_control.msg_textview - tb = tv.get_buffer() - h_id = tb.connect('changed', self.textbuffer_live_acronym_expander) - d['h_id'] = h_id - - chat_control.acronyms_expander_plugin_data = d - - return True - - @log_calls('AcronymsExpanderPlugin') - def disconnect_from_chat_control_base(self, chat_control): - d = chat_control.acronyms_expander_plugin_data - tv = chat_control.msg_textview - tv.get_buffer().disconnect(d['h_id']) diff -r ce68139c3179 -r 2b03ab714d38 plugins/acronyms_expander/__init__.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/acronyms_expander/__init__.py Thu Sep 23 21:43:07 2010 +0200 @@ -0,0 +1,1 @@ +from acronyms_expander import AcronymsExpanderPlugin diff -r ce68139c3179 -r 2b03ab714d38 plugins/acronyms_expander/acronyms_expander.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/acronyms_expander/acronyms_expander.py Thu Sep 23 21:43:07 2010 +0200 @@ -0,0 +1,96 @@ +# -*- coding: utf-8 -*- + +## This file is part of Gajim. +## +## Gajim is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published +## by the Free Software Foundation; version 3 only. +## +## Gajim is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with Gajim. If not, see <
http://www.gnu.org/licenses/
>. +## + +''' +Acronyms expander plugin. + +:author: Mateusz Biliński <mateusz(a)bilinski.it> +:since: 9th June 2008
1
0
0
0
gajim: spread presence handler into classes that really need it
by Yann Leboulanger
23 Sep '10
23 Sep '10
changeset ce68139c3179 in /home/hg/repos/gajim
details:http://hg.gajim.org/gajim?cmd=changeset;node=ce68139c3179
description: spread presence handler into classes that really need it diffstat: src/common/connection_handlers.py | 127 ++++++++++++++ src/common/connection_handlers_events.py | 10 +- src/dialogs.py | 13 + src/gui_interface.py | 277 +++++------------------------- src/roster_window.py | 43 ++++- 5 files changed, 242 insertions(+), 228 deletions(-) diffs (truncated from 596 to 300 lines): diff -r 34fffe2e37df -r ce68139c3179 src/common/connection_handlers.py --- a/src/common/connection_handlers.py Wed Sep 22 18:20:01 2010 +0200 +++ b/src/common/connection_handlers.py Thu Sep 23 20:46:47 2010 +0200 @@ -1115,6 +1115,8 @@ self._nec_gmail_new_mail_received) gajim.ged.register_event_handler('ping-received', ged.CORE, self._nec_ping_received) + gajim.ged.register_event_handler('presence-received', ged.CORE, + self._nec_presence_received) def build_http_auth_answer(self, iq_obj, answer): if not self.connection or self.connected < 2: @@ -1743,6 +1745,131 @@ gajim.nec.push_incoming_event(NetworkEvent('raw-pres-received', conn=self, iq_obj=prs)) + def _nec_presence_received(self, obj): + account = obj.conn.name + jid = obj.jid + resource = obj.resource or '' + + statuss = ['offline', 'error', 'online', 'chat', 'away', 'xa', 'dnd', + 'invisible'] + obj.old_show = 0 + obj.new_show = statuss.index(obj.show) + + obj.contact_list = [] + + highest = gajim.contacts.get_contact_with_highest_priority(account, jid) + obj.was_highest = (highest and highest.resource == resource) + + # Update contact + obj.contact_list = gajim.contacts.get_contacts(account, jid) + obj.contact = None + resources = [] + for c in obj.contact_list: + resources.append(c.resource) + if c.resource == resource: + obj.contact = c + break + + if obj.contact: + obj.old_show = statuss.index(obj.contact.show) + # nick changed + if obj.contact_nickname is not None and \ + obj.contact.contact_name != obj.contact_nickname: + obj.contact.contact_name = obj.contact_nickname + obj.need_redraw = True +# gajim.interface.roster.draw_contact(jid, account) + + if obj.old_show == obj.new_show and obj.contact.status == \ + obj.status and obj.contact.priority == obj.prio: # no change + return + else: + obj.contact = gajim.contacts.get_first_contact_from_jid(account, + jid) + if not obj.contact: + # Presence of another resource of our jid + # Create self contact and add to roster + if resource == obj.conn.server_resource: + return + # Ignore offline presence of unknown self resource + if obj.new_show < 2: + return + obj.contact = gajim.contacts.create_self_contact(jid=jid, + account=account, show=obj.show, status=obj.status, + priority=obj.prio, keyID=obj.keyID, + resource=obj.resource) + gajim.contacts.add_contact(account, obj.contact) + obj.contact_list.append(obj.contact) + else: + obj.old_show = statuss.index(obj.contact.show) + if (resources != [''] and (len(obj.contact_list) != 1 or \ + obj.contact_list[0].show != 'offline')) and \ + not gajim.jid_is_transport(jid): + # Another resource of an existing contact connected + obj.old_show = 0 + obj.contact = gajim.contacts.copy_contact(obj.contact) + obj.contact_list.append(obj.contact) + obj.contact.resource = resource + + obj.need_add_in_roster = True +# gajim.interface.roster.add_contact(jid, account) + + if not gajim.jid_is_transport(jid) and len(obj.contact_list) == 1: + # It's not an agent + if obj.old_show == 0 and obj.new_show > 1: + if not jid in gajim.newly_added[account]: + gajim.newly_added[account].append(jid) + if jid in gajim.to_be_removed[account]: + gajim.to_be_removed[account].remove(jid) + elif obj.old_show > 1 and obj.new_show == 0 and \ + obj.conn.connected > 1: + if not jid in gajim.to_be_removed[account]: + gajim.to_be_removed[account].append(jid) + if jid in gajim.newly_added[account]: + gajim.newly_added[account].remove(jid) + obj.need_redraw = True +# self.roster.draw_contact(jid, account) + + obj.contact.show = obj.show + obj.contact.status = obj.status + obj.contact.priority = obj.prio + obj.contact.keyID = obj.keyID + if obj.timestamp: + obj.contact.last_status_time = obj.timestamp + elif not gajim.block_signed_in_notifications[account]: + # We're connected since more that 30 seconds + obj.contact.last_status_time = localtime() + obj.contact.contact_nickname = obj.contact_nickname + + if gajim.jid_is_transport(jid): + return + + # It isn't an agent + # reset chatstate if needed: + # (when contact signs out or has errors) + if obj.show in ('offline', 'error'): + obj.contact.our_chatstate = obj.contact.chatstate = \ + obj.contact.composing_xep = None + + # TODO: This causes problems when another + # resource signs off! + self.stop_all_active_file_transfers(obj.contact) + + # disable encryption, since if any messages are + # lost they'll be not decryptable (note that + # this contradicts XEP-0201 - trying to get that + # in the XEP, though) + + # there won't be any sessions here if the contact terminated + # their sessions before going offline (which we do) + for sess in self.get_sessions(jid): + if obj.fjid != str(sess.jid): + continue + if sess.control: + sess.control.no_autonegotiation = False + if sess.enable_encryption: + sess.terminate_e2e() + self.delete_session(jid, sess.thread_id) + def _StanzaArrivedCB(self, con, obj): self.last_io = gajim.idlequeue.current_time() diff -r 34fffe2e37df -r ce68139c3179 src/common/connection_handlers_events.py --- a/src/common/connection_handlers_events.py Wed Sep 22 18:20:01 2010 +0200 +++ b/src/common/connection_handlers_events.py Thu Sep 23 20:46:47 2010 +0200 @@ -604,6 +604,10 @@ def generate(self): self.conn = self.base_event.conn self.iq_obj = self.base_event.iq_obj + + self.need_add_in_roster = False + self.need_redraw = False + self.ptype = self.iq_obj.getType() if self.ptype == 'available': self.ptype = None @@ -627,6 +631,10 @@ _('Nickname not allowed: %s') % resource, None, False, None, [])) return + jid_list = gajim.contacts.get_jid_list(self.conn.name) +# if self.jid not in jid_list and self.jid != gajim.get_jid_from_account( +# self.conn.name): +# return self.timestamp = None self.get_id() self.is_gc = False # is it a GC presence ? @@ -957,5 +965,5 @@ self.conn.server_resource: # We got our own presence self.conn.dispatch('STATUS', self.show) - else: + elif self.jid in jid_list: return True diff -r 34fffe2e37df -r ce68139c3179 src/dialogs.py --- a/src/dialogs.py Wed Sep 22 18:20:01 2010 +0200 +++ b/src/dialogs.py Thu Sep 23 20:46:47 2010 +0200 @@ -995,12 +995,17 @@ message_buffer.set_text(helpers.get_subscription_request_msg( self.account)) + gajim.ged.register_event_handler('presence-received', ged.GUI1, + self._nec_presence_received) + def on_add_new_contact_window_destroy(self, widget): if self.account: location = gajim.interface.instances[self.account] else: location = gajim.interface.instances del location['add_contact'] + gajim.ged.remove_event_handler('presence-received', ged.GUI1, + self._nec_presence_received) def on_register_button_clicked(self, widget): jid = self.protocol_jid_combobox.get_active_text().decode('utf-8') @@ -1154,6 +1159,14 @@ self.connected_label.show() self.add_button.set_sensitive(False) + def _nec_presence_received(self, obj): + if gajim.jid_is_transport(obj.jid): + if obj.old_show == 0 and obj.new_show > 1: + self.transport_signed_in(obj.jid) + elif obj.old_show > 1 and obj.new_show == 0: + self.transport_signed_out(obj.jid) + + class AboutDialog: """ Class for about dialog diff -r 34fffe2e37df -r ce68139c3179 src/gui_interface.py --- a/src/gui_interface.py Wed Sep 22 18:20:01 2010 +0200 +++ b/src/gui_interface.py Thu Sep 23 20:46:47 2010 +0200 @@ -290,249 +290,76 @@ # # Contact changed show - # FIXME: Drop and rewrite... - - statuss = ['offline', 'error', 'online', 'chat', 'away', 'xa', 'dnd', - 'invisible'] - account = obj.conn.name jid = obj.jid show = obj.show status = obj.status resource = obj.resource or '' - priority = obj.prio - keyID = obj.keyID - timestamp = obj.timestamp - contact_nickname = obj.contact_nickname - - obj.old_show = 0 - obj.new_show = statuss.index(show) - - lcontact = [] - - highest = gajim.contacts.get_contact_with_highest_priority(account, jid) - was_highest = (highest and highest.resource == resource) - - # Update contact + jid_list = gajim.contacts.get_jid_list(account) - if jid in jid_list or jid == gajim.get_jid_from_account(account): - lcontact = gajim.contacts.get_contacts(account, jid) - contact1 = None - resources = [] - for c in lcontact: - resources.append(c.resource) - if c.resource == resource: - contact1 = c - break - - if contact1: - if contact1.show in statuss: - obj.old_show = statuss.index(contact1.show) - # nick changed - if contact_nickname is not None and \ - contact1.contact_name != contact_nickname: - contact1.contact_name = contact_nickname - self.roster.draw_contact(jid, account) - - if obj.old_show == obj.new_show and contact1.status == status \ - and contact1.priority == priority: # no change - return - else: - contact1 = gajim.contacts.get_first_contact_from_jid(account, - jid) - if not contact1: - # Presence of another resource of our - # jid - # Create self contact and add to roster - if resource == obj.conn.server_resource: - return - # Ignore offline presence of unknown self resource - if obj.new_show < 2: - return - contact1 = gajim.contacts.create_self_contact(jid=jid, - account=account, show=show, status=status, - priority=priority, keyID=keyID, resource=resource) - obj.old_show = 0 - gajim.contacts.add_contact(account, contact1) - lcontact.append(contact1) - elif contact1.show in statuss: - obj.old_show = statuss.index(contact1.show) - if (resources != [''] and (len(lcontact) != 1 or \ - lcontact[0].show != 'offline')) and \ - not gajim.jid_is_transport(jid): - # Another resource of an existing contact connected - obj.old_show = 0 - contact1 = gajim.contacts.copy_contact(contact1) - lcontact.append(contact1) - contact1.resource = resource - - self.roster.add_contact(contact1.jid, account) - - if not gajim.jid_is_transport(contact1.jid) and len(lcontact) == 1: - # It's not an agent
1
0
0
0
gajim: fix typo
by Yann Leboulanger
23 Sep '10
23 Sep '10
changeset 34fffe2e37df in /home/hg/repos/gajim
details:http://hg.gajim.org/gajim?cmd=changeset;node=34fffe2e37df
description: fix typo diffstat: src/common/connection_handlers_events.py | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diffs (20 lines): diff -r a26a69ba790c -r 34fffe2e37df src/common/connection_handlers_events.py --- a/src/common/connection_handlers_events.py Fri Sep 17 12:41:30 2010 +0200 +++ b/src/common/connection_handlers_events.py Wed Sep 22 18:20:01 2010 +0200 @@ -611,7 +611,6 @@ 'unsubscribe', 'unsubscribed') if self.ptype and not self.ptype in rfc_types: self.ptype = None - log.debug('PresenceCB: %s' % self.ptype) if not self.conn or self.conn.connected < 2: log.debug('account is no more connected') return @@ -768,7 +767,7 @@ gajim.config.should_log(self.conn.name, self.jid): gc_c = gajim.contacts.get_gc_contact(self.conn.name, self.jid, self.resource) - st = status or '' + st = self.status or '' if gc_c: jid = gc_c.jid else:
1
0
0
0
gajim: first show to use NEC to handle presence events
by Yann Leboulanger
23 Sep '10
23 Sep '10
changeset a26a69ba790c in /home/hg/repos/gajim
details:http://hg.gajim.org/gajim?cmd=changeset;node=a26a69ba790c
description: first show to use NEC to handle presence events diffstat: src/common/connection_handlers.py | 343 +---------------------------- src/common/connection_handlers_events.py | 368 +++++++++++++++++++++++++++++++ src/gui_interface.py | 161 +++++------- src/remote_control.py | 17 +- 4 files changed, 458 insertions(+), 431 deletions(-) diffs (truncated from 1120 to 300 lines): diff -r 8f32c19838fa -r a26a69ba790c src/common/connection_handlers.py --- a/src/common/connection_handlers.py Fri Sep 17 12:41:00 2010 +0200 +++ b/src/common/connection_handlers.py Fri Sep 17 12:41:30 2010 +0200 @@ -1089,6 +1089,7 @@ PrivateStorageRosternotesReceivedEvent) gajim.nec.register_incoming_event(RosternotesReceivedEvent) gajim.nec.register_incoming_event(StreamConflictReceivedEvent) + gajim.nec.register_incoming_event(PresenceReceivedEvent) gajim.ged.register_event_handler('http-auth-received', ged.CORE, self._nec_http_auth_received) @@ -1738,347 +1739,9 @@ """ Called when we receive a presence """ + log.debug('PresenceCB') gajim.nec.push_incoming_event(NetworkEvent('raw-pres-received', - conn=con, xmpp_pres=prs)) - ptype = prs.getType() - if ptype == 'available': - ptype = None - rfc_types = ('unavailable', 'error', 'subscribe', 'subscribed', - 'unsubscribe', 'unsubscribed') - if ptype and not ptype in rfc_types: - ptype = None - log.debug('PresenceCB: %s' % ptype) - if not self.connection or self.connected < 2: - log.debug('account is no more connected') - return - try: - who = helpers.get_full_jid_from_iq(prs) - except Exception: - if prs.getTag('error') and prs.getTag('error').getTag('jid-malformed'): - # wrong jid, we probably tried to change our nick in a room to a non - # valid one - who = str(prs.getFrom()) - jid_stripped, resource = gajim.get_room_and_nick_from_fjid(who) - self.dispatch('GC_MSG', (jid_stripped, - _('Nickname not allowed: %s') % resource, None, False, None, [])) - return - jid_stripped, resource = gajim.get_room_and_nick_from_fjid(who) - timestamp = None - id_ = prs.getID() - is_gc = False # is it a GC presence ? - sigTag = None - ns_muc_user_x = None - avatar_sha = None - # XEP-0172 User Nickname - user_nick = prs.getTagData('nick') - if not user_nick: - user_nick = '' - contact_nickname = None - transport_auto_auth = False - # XEP-0203 - delay_tag = prs.getTag('delay', namespace=common.xmpp.NS_DELAY2) - if delay_tag: - tim = prs.getTimestamp2() - tim = helpers.datetime_tuple(tim) - timestamp = localtime(timegm(tim)) - xtags = prs.getTags('x') - for x in xtags: - namespace = x.getNamespace() - if namespace.startswith(common.xmpp.NS_MUC): - is_gc = True - if namespace == common.xmpp.NS_MUC_USER and x.getTag('destroy'): - ns_muc_user_x = x - elif namespace == common.xmpp.NS_SIGNED: - sigTag = x - elif namespace == common.xmpp.NS_VCARD_UPDATE: - avatar_sha = x.getTagData('photo') - contact_nickname = x.getTagData('nickname') - elif namespace == common.xmpp.NS_DELAY and not timestamp: - # XEP-0091 - tim = prs.getTimestamp() - tim = helpers.datetime_tuple(tim) - timestamp = localtime(timegm(tim)) - elif namespace == '
http://delx.cjb.net/protocol/roster-subsync
': - # see
http://trac.gajim.org/ticket/326
- agent = gajim.get_server_from_jid(jid_stripped) - if self.connection.getRoster().getItem(agent): # to be sure it's a transport contact - transport_auto_auth = True - - if not is_gc and id_ and id_.startswith('gajim_muc_') and \ - ptype == 'error': - # Error presences may not include sent stanza, so we don't detect it's - # a muc preence. So detect it by ID - h = hmac.new(self.secret_hmac, jid_stripped).hexdigest()[:6] - if id_.split('_')[-1] == h: - is_gc = True - status = prs.getStatus() or '' - show = prs.getShow() - if show not in ('chat', 'away', 'xa', 'dnd'): - show = '' # We ignore unknown show - if not ptype and not show: - show = 'online' - elif ptype == 'unavailable': - show = 'offline' - - prio = prs.getPriority() - try: - prio = int(prio) - except Exception: - prio = 0 - keyID = '' - if sigTag and self.USE_GPG and ptype != 'error': - # error presences contain our own signature - # verify - sigmsg = sigTag.getData() - keyID = self.gpg.verify(status, sigmsg) - - if is_gc: - if ptype == 'error': - errcon = prs.getError() - errmsg = prs.getErrorMsg() - errcode = prs.getErrorCode() - room_jid, nick = gajim.get_room_and_nick_from_fjid(who) - - gc_control = gajim.interface.msg_win_mgr.get_gc_control(room_jid, - self.name) - - # If gc_control is missing - it may be minimized. Try to get it from - # there. If it's not there - then it's missing anyway and will - # remain set to None. - if gc_control is None: - minimized = gajim.interface.minimized_controls[self.name] - gc_control = minimized.get(room_jid) - - if errcode == '502': - # Internal Timeout: - self.dispatch('NOTIFY', (jid_stripped, 'error', errmsg, resource, - prio, keyID, timestamp, None)) - elif (errcode == '503'): - if gc_control is None or gc_control.autorejoin is None: - # maximum user number reached - self.dispatch('GC_ERROR', (gc_control, - _('Unable to join group chat'), - _('Maximum number of users for %s has been ' - 'reached') % room_jid)) - elif (errcode == '401') or (errcon == 'not-authorized'): - # password required to join - self.dispatch('GC_PASSWORD_REQUIRED', (room_jid, nick)) - elif (errcode == '403') or (errcon == 'forbidden'): - # we are banned - self.dispatch('GC_ERROR', (gc_control, - _('Unable to join group chat'), - _('You are banned from group chat %s.') % room_jid)) - elif (errcode == '404') or (errcon in ('item-not-found', - 'remote-server-not-found')): - if gc_control is None or gc_control.autorejoin is None: - # group chat does not exist - self.dispatch('GC_ERROR', (gc_control, - _('Unable to join group chat'), - _('Group chat %s does not exist.') % room_jid)) - elif (errcode == '405') or (errcon == 'not-allowed'): - self.dispatch('GC_ERROR', (gc_control, - _('Unable to join group chat'), - _('Group chat creation is restricted.'))) - elif (errcode == '406') or (errcon == 'not-acceptable'): - self.dispatch('GC_ERROR', (gc_control, - _('Unable to join group chat'), - _('Your registered nickname must be used in group chat ' - '%s.') % room_jid)) - elif (errcode == '407') or (errcon == 'registration-required'): - self.dispatch('GC_ERROR', (gc_control, - _('Unable to join group chat'), - _('You are not in the members list in groupchat %s.') %\ - room_jid)) - elif (errcode == '409') or (errcon == 'conflict'): - # nick conflict - room_jid = gajim.get_room_from_fjid(who) - self.dispatch('ASK_NEW_NICK', (room_jid,)) - else: # print in the window the error - self.dispatch('ERROR_ANSWER', ('', jid_stripped, - errmsg, errcode)) - if not ptype or ptype == 'unavailable': - if gajim.config.get('log_contact_status_changes') and \ - gajim.config.should_log(self.name, jid_stripped): - gc_c = gajim.contacts.get_gc_contact(self.name, jid_stripped, - resource) - st = status or '' - if gc_c: - jid = gc_c.jid - else: - jid = prs.getJid() - if jid: - # we know real jid, save it in db - st += ' (%s)' % jid - try: - gajim.logger.write('gcstatus', who, st, show) - except exceptions.PysqliteOperationalError, e: - self.dispatch('DB_ERROR', (_('Disk Write Error'), - str(e))) - except exceptions.DatabaseMalformed: - pritext = _('Database Error') - sectext = _('The database file (%s) cannot be read. Try to ' - 'repair it (see
http://trac.gajim.org/wiki/DatabaseBackup
)' - ' or remove it (all history will be lost).') % \ - common.logger.LOG_DB_PATH - self.dispatch('DB_ERROR', (pritext, sectext)) - if avatar_sha or avatar_sha == '': - if avatar_sha == '': - # contact has no avatar - puny_nick = helpers.sanitize_filename(resource) - gajim.interface.remove_avatar_files(jid_stripped, puny_nick) - # if it's a gc presence, don't ask vcard here. We may ask it to - # real jid in gui part. - if ns_muc_user_x: - # Room has been destroyed. see - #
http://www.xmpp.org/extensions/xep-0045.html#destroyroom
- reason = _('Room has been destroyed') - destroy = ns_muc_user_x.getTag('destroy') - r = destroy.getTagData('reason') - if r: - reason += ' (%s)' % r - if destroy.getAttr('jid'): - try: - jid = helpers.parse_jid(destroy.getAttr('jid')) - reason += '\n' + _('You can join this room instead: %s') \ - % jid - except common.helpers.InvalidFormat: - pass - statusCode = ['destroyed'] - else: - reason = prs.getReason() - statusCode = prs.getStatusCode() - self.dispatch('GC_NOTIFY', (jid_stripped, show, status, resource, - prs.getRole(), prs.getAffiliation(), prs.getJid(), - reason, prs.getActor(), statusCode, prs.getNewNick(), - avatar_sha)) - return - - if ptype == 'subscribe': - log.debug('subscribe request from %s' % who) - if who.find('@') <= 0 and who in self.agent_registrations: - self.agent_registrations[who]['sub_received'] = True - if not self.agent_registrations[who]['roster_push']: - # We'll reply after roster push result - return - if gajim.config.get_per('accounts', self.name, 'autoauth') or \ - who.find('@') <= 0 or jid_stripped in self.jids_for_auto_auth or \ - transport_auto_auth: - if self.connection: - p = common.xmpp.Presence(who, 'subscribed') - p = self.add_sha(p) - self.connection.send(p) - if who.find('@') <= 0 or transport_auto_auth: - self.dispatch('NOTIFY', (jid_stripped, 'offline', 'offline', - resource, prio, keyID, timestamp, None)) - if transport_auto_auth: - self.automatically_added.append(jid_stripped) - self.request_subscription(jid_stripped, name = user_nick) - else: - if not status: - status = _('I would like to add you to my roster.') - self.dispatch('SUBSCRIBE', (jid_stripped, status, user_nick)) - elif ptype == 'subscribed': - if jid_stripped in self.automatically_added: - self.automatically_added.remove(jid_stripped) - else: - # detect a subscription loop - if jid_stripped not in self.subscribed_events: - self.subscribed_events[jid_stripped] = [] - self.subscribed_events[jid_stripped].append(time_time()) - block = False - if len(self.subscribed_events[jid_stripped]) > 5: - if time_time() - self.subscribed_events[jid_stripped][0] < 5: - block = True - self.subscribed_events[jid_stripped] = self.subscribed_events[jid_stripped][1:] - if block: - gajim.config.set_per('account', self.name, - 'dont_ack_subscription', True) - else: - self.dispatch('SUBSCRIBED', (jid_stripped, resource)) - # BE CAREFUL: no con.updateRosterItem() in a callback - log.debug(_('we are now subscribed to %s') % who) - elif ptype == 'unsubscribe': - log.debug(_('unsubscribe request from %s') % who) - elif ptype == 'unsubscribed': - log.debug(_('we are now unsubscribed from %s') % who) - # detect a unsubscription loop - if jid_stripped not in self.subscribed_events: - self.subscribed_events[jid_stripped] = [] - self.subscribed_events[jid_stripped].append(time_time()) - block = False - if len(self.subscribed_events[jid_stripped]) > 5: - if time_time() - self.subscribed_events[jid_stripped][0] < 5: - block = True - self.subscribed_events[jid_stripped] = self.subscribed_events[jid_stripped][1:] - if block: - gajim.config.set_per('account', self.name, 'dont_ack_subscription', - True) - else: - self.dispatch('UNSUBSCRIBED', jid_stripped) - elif ptype == 'error': - errmsg = prs.getError() - errcode = prs.getErrorCode() - if errcode != '502': # Internal Timeout: - # print in the window the error - self.dispatch('ERROR_ANSWER', ('', jid_stripped, - errmsg, errcode))
1
0
0
0
gajim: ignore invalid payload types. Fixes #5919
by Yann Leboulanger
23 Sep '10
23 Sep '10
changeset 08932942dffe in /home/hg/repos/gajim
details:http://hg.gajim.org/gajim?cmd=changeset;node=08932942dffe
description: ignore invalid payload types. Fixes #5919 diffstat: src/common/jingle_rtp.py | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diffs (13 lines): diff -r ac3413a7823b -r 08932942dffe src/common/jingle_rtp.py --- a/src/common/jingle_rtp.py Tue Sep 21 21:44:04 2010 +0200 +++ b/src/common/jingle_rtp.py Thu Sep 23 13:05:33 2010 +0200 @@ -246,6 +246,9 @@ codecs = [] for codec in content.getTag('description').iterTags('payload-type'): + if not codec['id'] or not codec['name'] or not codec['clockrate']: + # ignore invalid payload-types + continue c = farsight.Codec(int(codec['id']), codec['name'], self.farsight_media, int(codec['clockrate'])) if 'channels' in codec:
1
0
0
0
← Newer
1
2
3
4
5
6
7
Older →
Jump to page:
1
2
3
4
5
6
7
Results per page:
10
25
50
100
200