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
October 2015
----- 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
1 participants
37 discussions
Start a n
N
ew thread
gajim-plugins: Better debug output when image loading fails
by Gajim Plugins
25 Oct '15
25 Oct '15
changeset 3019b29339f6 in /home/hg/repos/gajim-plugins author: tmolitor <thilo(a)eightysoft.de> branches: details:gajim-plugins?cmd=changeset;node=3019b29339f6 description: Better debug output when image loading fails diffstat: url_image_preview/manifest.ini | 2 +- url_image_preview/url_image_preview.py | 12 +++++++++--- 2 Dateien ver?ndert, 10 Zeilen hinzugef?gt(+), 4 Zeilen entfernt(-) Unterschiede (68 Zeilen): diff -r 060b01ce7504 -r 3019b29339f6 url_image_preview/manifest.ini --- a/url_image_preview/manifest.ini Sun Oct 25 20:47:27 2015 +0100 +++ b/url_image_preview/manifest.ini Sun Oct 25 21:08:42 2015 +0100 @@ -1,7 +1,7 @@ [info] name: Url image preview short_name: url_image_preview -version: 0.6.3 +version: 0.6.4 description: Url image preview in chatbox.<br/> Based on patch in <a href="
http://trac.gajim.org/attachment/ticket/5300
">ticket #5300</a>. authors = Denis Fomin <fominde(a)gmail.com> diff -r 060b01ce7504 -r 3019b29339f6 url_image_preview/url_image_preview.py --- a/url_image_preview/url_image_preview.py Sun Oct 25 20:47:27 2015 +0100 +++ b/url_image_preview/url_image_preview.py Sun Oct 25 21:08:42 2015 +0100 @@ -109,13 +109,17 @@ def _check_mime_size(self, (file_mime, file_size), url, repl_start, repl_end): # Check if mime type is acceptable + if file_mime == '' and file_size == 0: + # URL is already displayed + log.info("Failed to load HEAD Request for URL: '%s' (see debug log for more info)" % url) + return if file_mime.lower() not in ACCEPTED_MIME_TYPES: # URL is already displayed log.info("Not accepted mime type '%s' for URL: '%s'" % (file_mime.lower(), url)) return # Check if file size is acceptable if file_size > self.plugin.config['MAX_FILE_SIZE'] or file_size == 0: - log.info("File size too big or unknown for URL: '%s'" % url) + log.info("File size (%s) too big or unknown (zero) for URL: '%s'" % (str(file_size), url)) # URL is already displayed return @@ -159,7 +163,7 @@ raise else: # If image could not be downloaded, URL is already displayed - log.error('Could not download image for URL: %s' % url) + log.error('Could not download image for URL: %s -- %s' % (url, alt)) def _get_http_head (self, account, url): # Check if proxy is used @@ -177,14 +181,15 @@ f = urllib2.urlopen(req) except Exception, ex: log.debug('Could not get head response for URL: %s' % url) + log.debug("%s" % str(ex)) return ('', 0) url_headers = f.info() ctype = '' ctype_list = url_headers.getheaders('Content-Type') if ctype_list: ctype = ctype_list[0] + clen = 0 clen_list = url_headers.getheaders('Content-Length') - clen = 0 if clen_list: try: clen = int(clen_list[0]) @@ -233,6 +238,7 @@ headers = b.getvalue() except pycurl.error, ex: log.debug('Could not get head response for URL: %s' % url) + log.debug("%s" % str(ex)) return ('', 0) ctype = ''
1
0
0
0
gajim-plugins: Fixed some bugs in the httpupload feature detecti...
by Gajim Plugins
25 Oct '15
25 Oct '15
changeset 060b01ce7504 in /home/hg/repos/gajim-plugins author: tmolitor <thilo(a)eightysoft.de> branches: details:gajim-plugins?cmd=changeset;node=060b01ce7504 description: Fixed some bugs in the httpupload feature detection when reconnecting diffstat: httpupload/httpupload.py | 91 ++++++++++++++++++++++++++++------------------- httpupload/manifest.ini | 2 +- 2 Dateien ver?ndert, 55 Zeilen hinzugef?gt(+), 38 Zeilen entfernt(-) Unterschiede (139 Zeilen): diff -r 873d456200c9 -r 060b01ce7504 httpupload/httpupload.py --- a/httpupload/httpupload.py Sat Oct 24 16:08:04 2015 +0200 +++ b/httpupload/httpupload.py Sun Oct 25 20:47:27 2015 +0100 @@ -80,37 +80,7 @@ @log_calls('HttpuploadPlugin') def connect_with_chat_control(self, control): - global jid_to_servers - global iq_ids_to_callbacks - global last_info_query self.chat_control = control - # query info at most every 300 seconds (5 minutes) in case something goes wrong - if (not self.chat_control.account in last_info_query or \ - last_info_query[self.chat_control.account] + 300 < time.time()) and \ - not gajim.get_jid_from_account(self.chat_control.account) in jid_to_servers and \ - gajim.account_is_connected(self.chat_control.account): - log.info("Account %s: Using dicovery to find jid of httpupload component" % self.chat_control.account) - id_ = gajim.get_an_id() - iq = nbxmpp.Iq( - typ='get', - to=gajim.get_server_from_jid(gajim.get_jid_from_account(self.chat_control.account)), - queryNS="
http://jabber.org/protocol/disco#items
" - ) - iq.setID(id_) - def query_info(stanza): - global last_info_query - for item in stanza.getTag("query").getTags("item"): - id_ = gajim.get_an_id() - iq = nbxmpp.Iq( - typ='get', - to=item.getAttr("jid"), - queryNS="
http://jabber.org/protocol/disco#info
" - ) - iq.setID(id_) - gajim.connections[control.account].connection.send(iq) - last_info_query[self.chat_control.account] = time.time() - iq_ids_to_callbacks[str(id_)] = query_info - gajim.connections[self.chat_control.account].connection.send(iq) base = Base(self, self.chat_control) self.controls.append(base) if self.first_run: @@ -129,16 +99,60 @@ @log_calls('HttpuploadPlugin') def update_button_state(self, chat_control): + global jid_to_servers + global iq_ids_to_callbacks + global last_info_query + + if gajim.connections[chat_control.account].connection == None and \ + gajim.get_jid_from_account(chat_control.account) in jid_to_servers: + # maybe don't delete this and detect vanished upload components when actually trying to upload something + log.info("Deleting %s from jid_to_servers (disconnected)" % gajim.get_jid_from_account(chat_control.account)) + del jid_to_servers[gajim.get_jid_from_account(chat_control.account)] + #pass + + # query info at most every 60 seconds in case something goes wrong + if (not chat_control.account in last_info_query or \ + last_info_query[chat_control.account] + 60 < time.time()) and \ + not gajim.get_jid_from_account(chat_control.account) in jid_to_servers and \ + gajim.account_is_connected(chat_control.account): + log.info("Account %s: Using dicovery to find jid of httpupload component" % chat_control.account) + id_ = gajim.get_an_id() + iq = nbxmpp.Iq( + typ='get', + to=gajim.get_server_from_jid(gajim.get_jid_from_account(chat_control.account)), + queryNS="
http://jabber.org/protocol/disco#items
" + ) + iq.setID(id_) + def query_info(stanza): + global last_info_query + for item in stanza.getTag("query").getTags("item"): + id_ = gajim.get_an_id() + iq = nbxmpp.Iq( + typ='get', + to=item.getAttr("jid"), + queryNS="
http://jabber.org/protocol/disco#info
" + ) + iq.setID(id_) + last_info_query[chat_control.account] = time.time() + gajim.connections[chat_control.account].connection.send(iq) + iq_ids_to_callbacks[str(id_)] = query_info + gajim.connections[chat_control.account].connection.send(iq) + #send disco query to main server jid + id_ = gajim.get_an_id() + iq = nbxmpp.Iq( + typ='get', + to=gajim.get_server_from_jid(gajim.get_jid_from_account(chat_control.account)), + queryNS="
http://jabber.org/protocol/disco#info
" + ) + iq.setID(id_) + last_info_query[chat_control.account] = time.time() + gajim.connections[chat_control.account].connection.send(iq) + for base in self.controls: if base.chat_control == chat_control: - if gajim.connections[chat_control.account].connection == None and \ - gajim.get_jid_from_account(chat_control.account) in jid_to_servers: - # maybe don't delete this and detect vanished upload components when actually trying to upload something - log.info("Deleting %s from jid_to_servers (disconnected)" % gajim.get_jid_from_account(chat_control.account)) - del jid_to_servers[gajim.get_jid_from_account(chat_control.account)] - #pass is_supported = gajim.get_jid_from_account(chat_control.account) in jid_to_servers and \ gajim.connections[chat_control.account].connection != None + log.info("Account %s: httpupload is_supported: %s" % (str(chat_control.account), str(is_supported))) if not is_supported: text = _('Your server does not support http uploads') image_text = text @@ -354,6 +368,9 @@ xhtml = '<body><br/><a href="%s"> <img alt="%s" src="data:image/png;base64,%s"/> </a></body>' % \ (get.getData(), get.getData(), thumb) progress_window.close_dialog() + id_ = gajim.get_an_id() + def add_oob_tag(): + pass self.chat_control.send_message(message=get.getData(), xhtml=xhtml) self.chat_control.msg_textview.grab_focus() else: @@ -391,7 +408,7 @@ is_supported = gajim.get_jid_from_account(self.chat_control.account) in jid_to_servers and \ gajim.connections[self.chat_control.account].connection != None - log.debug("jid_to_servers of %s: %s ; connection: %s" % (gajim.get_jid_from_account(self.chat_control.account), str(jid_to_servers[gajim.get_jid_from_account(self.chat_control.account)]), str(gajim.connections[self.chat_control.account].connection))) + log.info("jid_to_servers of %s: %s ; connection: %s" % (gajim.get_jid_from_account(self.chat_control.account), str(jid_to_servers[gajim.get_jid_from_account(self.chat_control.account)]), str(gajim.connections[self.chat_control.account].connection))) if not is_supported: progress_window.close_dialog() log.error("upload component vanished, account got disconnected??") diff -r 873d456200c9 -r 060b01ce7504 httpupload/manifest.ini --- a/httpupload/manifest.ini Sat Oct 24 16:08:04 2015 +0200 +++ b/httpupload/manifest.ini Sun Oct 25 20:47:27 2015 +0100 @@ -1,7 +1,7 @@ [info] name: HttpUpload short_name: httpupload -version: 0.3.1 +version: 0.3.2 description: This plugin is designed to send a file to a contact or muc by using httpupload.<br/> Your server must support <a href="
http://xmpp.org/extensions/xep-0363.html
">XEP-0363: HTTP Upload</a>.<br/> Conversations supported this.<br/>
1
0
0
0
gajim: add new option to allow popup notifications when a chat c...
by Gajim
25 Oct '15
25 Oct '15
changeset 193495212d31 in /home/hg/repos/gajim author: Yann Leboulanger <asterix(a)lagaule.org> branches:
details:http://hg.gajim.org/gajim?cmd=changeset;node=193495212d31
description: add new option to allow popup notifications when a chat control is opened. See #7891, #8158 diffstat: data/gui/preferences_window.ui | 21 +++++++++++++++++++-- src/common/config.py | 1 + src/common/connection_handlers_events.py | 21 +++++++++++---------- src/config.py | 29 +++++++++++++++++++---------- src/conversation_textview.py | 2 +- 5 files changed, 51 insertions(+), 23 deletions(-) diffs (179 lines): diff -r d8128b776f31 -r 193495212d31 data/gui/preferences_window.ui --- a/data/gui/preferences_window.ui Wed Sep 30 20:00:48 2015 +0200 +++ b/data/gui/preferences_window.ui Sun Oct 25 15:06:37 2015 +0100 @@ -683,6 +683,23 @@ </packing> </child> <child> + <object class="GtkCheckButton" id="auto_popup_chat_opened_checkbutton"> + <property name="label" translatable="yes">Allow popup/notifications when a chat window is opened</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_underline">True</property> + <property name="xalign">0</property> + <property name="draw_indicator">True</property> + <signal name="toggled" handler="on_auto_popup_chat_opened_checkbutton_toggled" swapped="no"/> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">4</property> + </packing> + </child> + <child> <object class="GtkFrame" id="frame_gmail"> <property name="visible">True</property> <property name="sensitive">False</property> @@ -748,7 +765,7 @@ <packing> <property name="expand">False</property> <property name="fill">False</property> - <property name="position">4</property> + <property name="position">5</property> </packing> </child> <child> @@ -791,7 +808,7 @@ <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">5</property> + <property name="position">6</property> </packing> </child> </object> diff -r d8128b776f31 -r 193495212d31 src/common/config.py --- a/src/common/config.py Wed Sep 30 20:00:48 2015 +0200 +++ b/src/common/config.py Sun Oct 25 15:06:37 2015 +0100 @@ -73,6 +73,7 @@ 'notify_on_signout': [ opt_bool, False ], 'notify_on_new_message': [ opt_bool, True ], 'autopopupaway': [ opt_bool, False ], + 'autopopup_chat_opened': [ opt_bool, False, _('Show desktop notification even when a chat window is opened for this contact and does not have focus') ], 'sounddnd': [ opt_bool, False, _('Play sound when user is busy')], 'use_notif_daemon': [ opt_bool, True, _('Use D-Bus and Notification-Daemon to show notifications') ], 'showoffline': [ opt_bool, False ], diff -r d8128b776f31 -r 193495212d31 src/common/connection_handlers_events.py --- a/src/common/connection_handlers_events.py Wed Sep 30 20:00:48 2015 +0200 +++ b/src/common/connection_handlers_events.py Sun Oct 25 15:06:37 2015 +0100 @@ -2302,7 +2302,7 @@ if self.control: parent_win = self.control.parent_win if parent_win and self.control == parent_win.get_active_control() \ - and parent_win.window.has_focus: + and parent_win.window.get_property('has-toplevel-focus'): self.control_focused = True def handle_incoming_msg_event(self, msg_obj): @@ -2364,15 +2364,16 @@ self.popup_title = _('New Message from %(nickname)s') % \ {'nickname': nick} - if not gajim.config.get('notify_on_new_message') or \ - not self.first_unread: - self.do_popup = False - elif gajim.config.get('autopopupaway'): - # always show notification - self.do_popup = True - elif gajim.connections[self.conn.name].connected in (2, 3): - # we're online or chat - self.do_popup = True + + if gajim.config.get('notify_on_new_message'): + if self.first_unread or (gajim.config.get('autopopup_chat_opened') \ + and not self.control_focused): + if gajim.config.get('autopopupaway'): + # always show notification + self.do_popup = True + if gajim.connections[self.conn.name].connected in (2, 3): + # we're online or chat + self.do_popup = True if msg_obj.attention and not gajim.config.get( 'ignore_incoming_attention'): diff -r d8128b776f31 -r 193495212d31 src/config.py --- a/src/config.py Wed Sep 30 20:00:48 2015 +0200 +++ b/src/config.py Sun Oct 25 15:06:37 2015 +0100 @@ -97,36 +97,38 @@ self.window = self.xml.get_object('preferences_window') self.window.set_transient_for(gajim.interface.roster.window) self.notebook = self.xml.get_object('preferences_notebook') - self.one_window_type_combobox =\ - self.xml.get_object('one_window_type_combobox') + self.one_window_type_combobox = self.xml.get_object( + 'one_window_type_combobox') self.iconset_combobox = self.xml.get_object('iconset_combobox') self.notify_on_signin_checkbutton = self.xml.get_object( - 'notify_on_signin_checkbutton') + 'notify_on_signin_checkbutton') self.notify_on_signout_checkbutton = self.xml.get_object( - 'notify_on_signout_checkbutton') + 'notify_on_signout_checkbutton') self.auto_popup_away_checkbutton = self.xml.get_object( - 'auto_popup_away_checkbutton') + 'auto_popup_away_checkbutton') + self.auto_popup_chat_opened_checkbutton = self.xml.get_object( + 'auto_popup_chat_opened_checkbutton') self.sound_dnd_checkbutton = self.xml.get_object('sound_dnd_checkbutton') self.auto_away_checkbutton = self.xml.get_object('auto_away_checkbutton') self.auto_away_time_spinbutton = self.xml.get_object( - 'auto_away_time_spinbutton') + 'auto_away_time_spinbutton') self.auto_away_message_entry = self.xml.get_object( - 'auto_away_message_entry') + 'auto_away_message_entry') self.auto_xa_checkbutton = self.xml.get_object('auto_xa_checkbutton') self.auto_xa_time_spinbutton = self.xml.get_object( - 'auto_xa_time_spinbutton') + 'auto_xa_time_spinbutton') self.auto_xa_message_entry = self.xml.get_object('auto_xa_message_entry') ### General tab ### # Display avatars in roster st = gajim.config.get('show_avatars_in_roster') self.xml.get_object('show_avatars_in_roster_checkbutton'). \ - set_active(st) + set_active(st) # Display status msg under contact name in roster st = gajim.config.get('show_status_msgs_in_roster') self.xml.get_object('show_status_msgs_in_roster_checkbutton'). \ - set_active( st) + set_active( st) # Display PEP in roster st1 = gajim.config.get('show_mood_in_roster') @@ -313,6 +315,10 @@ st = gajim.config.get('autopopupaway') self.auto_popup_away_checkbutton.set_active(st) + # autopopup_chat_opened + st = gajim.config.get('autopopup_chat_opened') + self.auto_popup_chat_opened_checkbutton.set_active(st) + # sounddnd st = gajim.config.get('sounddnd') self.sound_dnd_checkbutton.set_active(st) @@ -847,6 +853,9 @@ def on_auto_popup_away_checkbutton_toggled(self, widget): self.on_checkbutton_toggled(widget, 'autopopupaway') + def on_auto_popup_chat_opened_checkbutton_toggled(self, widget): + self.on_checkbutton_toggled(widget, 'autopopup_chat_opened') + def on_sound_dnd_checkbutton_toggled(self, widget): self.on_checkbutton_toggled(widget, 'sounddnd') diff -r d8128b776f31 -r 193495212d31 src/conversation_textview.py --- a/src/conversation_textview.py Wed Sep 30 20:00:48 2015 +0200 +++ b/src/conversation_textview.py Sun Oct 25 15:06:37 2015 +0100 @@ -125,7 +125,7 @@ if not parent: self._disconnect_signals() return - if isinstance(parent, gtk.EventBox): + if isinstance(parent, Gtk.EventBox): parent = parent.get_parent() if not parent: self._disconnect_signals()
1
0
0
0
gajim-plugins: Fixed version detection bug
by Gajim Plugins
24 Oct '15
24 Oct '15
changeset 873d456200c9 in /home/hg/repos/gajim-plugins author: tmolitor <thilo(a)eightysoft.de> branches: details:gajim-plugins?cmd=changeset;node=873d456200c9 description: Fixed version detection bug diffstat: gotr/manifest.ini | 2 +- gotr/otrmodule.py | 3 +-- 2 Dateien ver?ndert, 2 Zeilen hinzugef?gt(+), 3 Zeilen entfernt(-) Unterschiede (32 Zeilen): diff -r c307cf81f963 -r 873d456200c9 gotr/manifest.ini --- a/gotr/manifest.ini Sat Oct 24 13:36:43 2015 +0200 +++ b/gotr/manifest.ini Sat Oct 24 16:08:04 2015 +0200 @@ -1,7 +1,7 @@ [info] name: Off-The-Record Encryption short_name: gotr -version: 1.9 +version: 1.9.1 description: Provide OTR encryption. Read <a href="
https://github.com/python-otr/gajim-otr/wiki
">
https://github.com/python-otr/gajim-otr/wiki
</a> before use. authors: Kjell Braden <afflux.gajim(a)pentabarf.de> homepage:
http://gajim-otr.pentabarf.de
diff -r c307cf81f963 -r 873d456200c9 gotr/otrmodule.py --- a/gotr/otrmodule.py Sat Oct 24 13:36:43 2015 +0200 +++ b/gotr/otrmodule.py Sat Oct 24 16:08:04 2015 +0200 @@ -69,7 +69,6 @@ from distutils.version import StrictVersion import common.xmpp -from common import defs from common import gajim from common import ged from common.connection_handlers_events import MessageOutgoingEvent @@ -288,7 +287,7 @@ self.handle_incoming_msg) self.events_handlers['before-change-show'] = (ged.PRECORE, self.handle_change_show) - if StrictVersion(defs.version) < StrictVersion(MINVERSION_OUTGOING_MSG_STAZA): + if StrictVersion(gajim.config.get('version')) < StrictVersion(MINVERSION_OUTGOING_MSG_STAZA): self.events_handlers['message-outgoing'] = (ged.OUT_PRECORE, self.handle_outgoing_msg) else:
1
0
0
0
gajim-plugins: [OTR] update description
by Gajim Plugins
24 Oct '15
24 Oct '15
changeset c307cf81f963 in /home/hg/repos/gajim-plugins author: Yann Leboulanger <asterix(a)lagaule.org> branches: details:gajim-plugins?cmd=changeset;node=c307cf81f963 description: [OTR] update description diffstat: gotr/manifest.ini | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diffs (12 lines): diff -r 0d88137a1b6c -r c307cf81f963 gotr/manifest.ini --- a/gotr/manifest.ini Sat Oct 24 13:08:35 2015 +0200 +++ b/gotr/manifest.ini Sat Oct 24 13:36:43 2015 +0200 @@ -2,7 +2,7 @@ name: Off-The-Record Encryption short_name: gotr version: 1.9 -description: Provide OTR encryption. See <a href="
http://www.cypherpunks.ca/otr/
">Author website</a> +description: Provide OTR encryption. Read <a href="
https://github.com/python-otr/gajim-otr/wiki
">
https://github.com/python-otr/gajim-otr/wiki
</a> before use. authors: Kjell Braden <afflux.gajim(a)pentabarf.de> homepage:
http://gajim-otr.pentabarf.de
max_gajim_version: 0.16.9
1
0
0
0
gajim: stop requesting MAM archive when we get the complete='tru...
by Gajim
24 Oct '15
24 Oct '15
changeset f97e0bf41644 in /home/hg/repos/gajim author: Yann Leboulanger <asterix(a)lagaule.org> branches: gajim_0.16
details:http://hg.gajim.org/gajim?cmd=changeset;node=f97e0bf41644
description: stop requesting MAM archive when we get the complete='true' attribute. Fixes #8170 diffstat: src/common/message_archiving.py | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diffs (14 lines): diff -r 676775867517 -r f97e0bf41644 src/common/message_archiving.py --- a/src/common/message_archiving.py Wed Sep 30 20:00:48 2015 +0200 +++ b/src/common/message_archiving.py Sat Oct 24 13:32:07 2015 +0200 @@ -103,7 +103,9 @@ last = set_.getTagData('last') if last: gajim.config.set_per('accounts', self.name, 'last_mam_id', last) - self.request_archive(after=last) + complete = fin_.getAttr('complete') + if complete != 'true': + self.request_archive(after=last) del self.awaiting_answers[queryid_]
1
0
0
0
gajim-plugins: [OTR] [fiaxh] mark OTR encrypted messages as priv...
by Gajim Plugins
24 Oct '15
24 Oct '15
changeset 0d88137a1b6c in /home/hg/repos/gajim-plugins author: Yann Leboulanger <asterix(a)lagaule.org> branches: details:gajim-plugins?cmd=changeset;node=0d88137a1b6c description: [OTR] [fiaxh] mark OTR encrypted messages as private. Fixes #116 diffstat: gotr/manifest.ini | 2 +- gotr/otrmodule.py | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 54 insertions(+), 6 deletions(-) diffs (129 lines): diff -r a6efe8973330 -r 0d88137a1b6c gotr/manifest.ini --- a/gotr/manifest.ini Tue Oct 13 00:19:12 2015 +0200 +++ b/gotr/manifest.ini Sat Oct 24 13:08:35 2015 +0200 @@ -1,7 +1,7 @@ [info] name: Off-The-Record Encryption short_name: gotr -version: 1.8 +version: 1.9 description: Provide OTR encryption. See <a href="
http://www.cypherpunks.ca/otr/
">Author website</a> authors: Kjell Braden <afflux.gajim(a)pentabarf.de> homepage:
http://gajim-otr.pentabarf.de
diff -r a6efe8973330 -r 0d88137a1b6c gotr/otrmodule.py --- a/gotr/otrmodule.py Tue Oct 13 00:19:12 2015 +0200 +++ b/gotr/otrmodule.py Sat Oct 24 13:08:35 2015 +0200 @@ -46,6 +46,8 @@ MMS = 1024 PROTOCOL = 'xmpp' +MINVERSION_OUTGOING_MSG_STAZA = "0.16.4" + enc_tip = 'A private chat session <i>is established</i> to this contact ' \ 'with this fingerprint' unused_tip = 'A private chat session is established to this contact using ' \ @@ -53,15 +55,21 @@ ended_tip = 'The private chat session to this contact has <i>ended</i>' inactive_tip = 'Communication to this contact is currently ' \ '<i>unencrypted</i>' +msg_not_send = _('Your message was not send. Either end ' + 'your private conversation, or restart it') + import logging +import nbxmpp import os import pickle import time import sys from pprint import pformat +from distutils.version import StrictVersion import common.xmpp +from common import defs from common import gajim from common import ged from common.connection_handlers_events import MessageOutgoingEvent @@ -134,6 +142,7 @@ session = appdata.get('session', None) if session is not None: stanza.setThread(session.thread_id) + add_message_processing_hints(stanza) gajim.connections[account].connection.send(stanza, now=True) def setState(self, newstate): @@ -279,8 +288,12 @@ self.handle_incoming_msg) self.events_handlers['before-change-show'] = (ged.PRECORE, self.handle_change_show) - self.events_handlers['message-outgoing'] = (ged.OUT_PRECORE, - self.handle_outgoing_msg) + if StrictVersion(defs.version) < StrictVersion(MINVERSION_OUTGOING_MSG_STAZA): + self.events_handlers['message-outgoing'] = (ged.OUT_PRECORE, + self.handle_outgoing_msg) + else: + self.events_handlers['stanza-message-outgoing'] = (ged.OUT_PRECORE, + self.handle_outgoing_msg_stanza) self.gui_extension_points = { 'chat_control' : (self.cc_connect, self.cc_disconnect) @@ -605,6 +618,39 @@ return PASS + def handle_outgoing_msg_stanza(self, event): + xhtml = event.msg_iq.getXHTML() + body = event.msg_iq.getBody() + encrypted = False + try: + if xhtml: + xhtml = xhtml.encode('utf8') + encrypted_msg = self.us[event.conn.name].\ + getContext(event.msg_iq.getTo()).\ + sendMessage(potr.context.FRAGMENT_SEND_ALL_BUT_LAST, xhtml) + if xhtml != encrypted_msg.strip(): #.strip() because sendMessage() adds whitespaces + encrypted = True + event.msg_iq.setXHTML(encrypted_msg) + elif body: + body = escape(body).encode('utf8') + encrypted_msg = self.us[event.conn.name].\ + getContext(event.msg_iq.getTo()).\ + sendMessage(potr.context.FRAGMENT_SEND_ALL_BUT_LAST, body) + if body != encrypted_msg.strip(): + encrypted = True + event.msg_iq.setBody(encrypted_msg) + except potr.context.NotEncryptedError, e: + if e.args[0] == potr.context.EXC_FINISHED: + self.gajim_log(msg_not_send, event.conn.name, event.msg_iq.getTo()) + return IGNORE + else: + raise e + + if encrypted: + add_message_processing_hints(event.msg_iq) + + return PASS + def handle_outgoing_msg(self, event): try: if hasattr(event, 'otrmessage'): @@ -635,9 +681,7 @@ potrrootlog.debug('processed message={0!r}'.format(newmsg)) except potr.context.NotEncryptedError, e: if e.args[0] == potr.context.EXC_FINISHED: - self.gajim_log(_('Your message was not send. Either end ' - 'your private conversation, or restart it'), event.account, - fjid) + self.gajim_log(msg_not_send, event.account, fjid) return IGNORE else: raise e @@ -695,3 +739,7 @@ s = s.replace("\n", "<br/>") return s +def add_message_processing_hints(stanza): + stanza.addChild(name='private', namespace=nbxmpp.NS_CARBONS) + stanza.addChild(name='no-permanent-store', namespace=nbxmpp.NS_MSG_HINTS) + stanza.addChild(name='no-copy', namespace=nbxmpp.NS_MSG_HINTS) \ No newline at end of file
1
0
0
0
gajim-plugins: Fixed some concurrency problems when using gtk te...
by Gajim Plugins
12 Oct '15
12 Oct '15
changeset a6efe8973330 in /home/hg/repos/gajim-plugins author: tmolitor <thilo(a)eightysoft.de> branches: details:gajim-plugins?cmd=changeset;node=a6efe8973330 description: Fixed some concurrency problems when using gtk textview from multiple threads... diffstat: url_image_preview/manifest.ini | 2 +- url_image_preview/url_image_preview.py | 33 +++++++++++++++++++-------------- 2 Dateien ver?ndert, 20 Zeilen hinzugef?gt(+), 15 Zeilen entfernt(-) Unterschiede (82 Zeilen): diff -r 3c8e529eba17 -r a6efe8973330 url_image_preview/manifest.ini --- a/url_image_preview/manifest.ini Sat Oct 10 14:32:24 2015 +0200 +++ b/url_image_preview/manifest.ini Tue Oct 13 00:19:12 2015 +0200 @@ -1,7 +1,7 @@ [info] name: Url image preview short_name: url_image_preview -version: 0.6.2 +version: 0.6.3 description: Url image preview in chatbox.<br/> Based on patch in <a href="
http://trac.gajim.org/attachment/ticket/5300
">ticket #5300</a>. authors = Denis Fomin <fominde(a)gmail.com> diff -r 3c8e529eba17 -r a6efe8973330 url_image_preview/url_image_preview.py --- a/url_image_preview/url_image_preview.py Sat Oct 10 14:32:24 2015 +0200 +++ b/url_image_preview/url_image_preview.py Tue Oct 13 00:19:12 2015 +0200 @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- import gtk +import gobject import re import os import urllib2 @@ -110,17 +111,17 @@ # Check if mime type is acceptable if file_mime.lower() not in ACCEPTED_MIME_TYPES: # URL is already displayed - log.info('Not accepted mime type for URL: %s' % url) + log.info("Not accepted mime type '%s' for URL: '%s'" % (file_mime.lower(), url)) return # Check if file size is acceptable if file_size > self.plugin.config['MAX_FILE_SIZE'] or file_size == 0: - log.info('File size too big or unknown for URL: %s' % url) + log.info("File size too big or unknown for URL: '%s'" % url) # URL is already displayed return # Start downloading image gajim.thread_interface(helpers.download_image, [ self.textview.account, { - 'src': url, 'max_size':self.plugin.config['MAX_FILE_SIZE'] } ], + 'src': url, 'max_size': self.plugin.config['MAX_FILE_SIZE'] } ], self._update_img, [url, file_mime, repl_start, repl_end]) def _update_img(self, (mem, alt), url, file_mime, repl_start, repl_end): @@ -132,22 +133,26 @@ pixbuf = loader.get_pixbuf() pixbuf, w, h = self.get_pixbuf_of_size(pixbuf, self.plugin.config['PREVIEW_SIZE']) - buffer_ = repl_start.get_buffer() - iter_ = buffer_.get_iter_at_mark(repl_start) - buffer_.insert(iter_, "\n") - anchor = buffer_.create_child_anchor(iter_) - # Use url as tooltip for image - img = TextViewImage(anchor, url) - img.set_from_pixbuf(pixbuf) eb = gtk.EventBox() eb.connect('button-press-event', self.on_button_press_event, url) eb.connect('enter-notify-event', self.on_enter_event) eb.connect('leave-notify-event', self.on_leave_event) - eb.add(img) - eb.show_all() - buffer_.delete(iter_, buffer_.get_iter_at_mark(repl_end)) - self.textview.tv.add_child_at_anchor(eb, anchor) + # this is threadsafe (gtk textview is NOT threadsafe by itself!!) + def add_to_textview(): + buffer_ = repl_start.get_buffer() + iter_ = buffer_.get_iter_at_mark(repl_start) + buffer_.insert(iter_, "\n") + anchor = buffer_.create_child_anchor(iter_) + # Use url as tooltip for image + img = TextViewImage(anchor, url) + img.set_from_pixbuf(pixbuf) + eb.add(img) + eb.show_all() + self.textview.tv.add_child_at_anchor(eb, anchor) + buffer_.delete(iter_, buffer_.get_iter_at_mark(repl_end)) + return False + gobject.idle_add(add_to_textview) except Exception: # URL is already displayed log.error('Could not display image for URL: %s' % url)
1
0
0
0
gajim-plugins: fix loading zip file under windows, ignore packs ...
by Gajim Plugins
10 Oct '15
10 Oct '15
changeset 3c8e529eba17 in /home/hg/repos/gajim-plugins author: Yann Leboulanger <asterix(a)lagaule.org> branches: details:gajim-plugins?cmd=changeset;node=3c8e529eba17 description: fix loading zip file under windows, ignore packs that can't be loaded. Fixes #114 diffstat: emoticons_pack/emoticons_pack.py | 27 +++++++++++++++------------ emoticons_pack/manifest.ini | 2 +- 2 files changed, 16 insertions(+), 13 deletions(-) diffs (55 lines): diff -r 3fb7dec776d0 -r 3c8e529eba17 emoticons_pack/emoticons_pack.py --- a/emoticons_pack/emoticons_pack.py Thu Oct 08 15:54:46 2015 +0200 +++ b/emoticons_pack/emoticons_pack.py Sat Oct 10 14:32:24 2015 +0200 @@ -282,24 +282,27 @@ conf.readfp(_file) for section in conf.sections(): # get icon - filename = conf.get(section, 'icon') - filename = os.path.join(section, filename) - zip_file = os.path.join(self.__path__, 'emoticons_pack.zip') - with zipfile.ZipFile(zip_file, 'r') as myzip: - icon_file = myzip.open(filename, mode='r') - data = icon_file.read() - pbl = gtk.gdk.PixbufLoader() - pbl.set_size(16, 16) - pbl.write(data) - pbl.close() - icon = pbl.get_pixbuf() + try: + filename = conf.get(section, 'icon') + filename = section + '/' + filename + zip_file = os.path.join(self.__path__, 'emoticons_pack.zip') + with zipfile.ZipFile(zip_file, 'r') as myzip: + icon_file = myzip.open(filename, mode='r') + data = icon_file.read() + pbl = gtk.gdk.PixbufLoader() + pbl.set_size(16, 16) + pbl.write(data) + pbl.close() + icon = pbl.get_pixbuf() + except Exception: + continue authors = _('Unknown') converter = _('Unknown') if conf.has_option(section, 'authors'): authors = conf.get(section, 'authors') if conf.has_option(section, 'converter'): - authors = conf.get(section, 'converter') + converter = conf.get(section, 'converter') self.model.append( [icon, section, diff -r 3fb7dec776d0 -r 3c8e529eba17 emoticons_pack/manifest.ini --- a/emoticons_pack/manifest.ini Thu Oct 08 15:54:46 2015 +0200 +++ b/emoticons_pack/manifest.ini Sat Oct 10 14:32:24 2015 +0200 @@ -1,7 +1,7 @@ [info] name: Emoticons pack short_name: emoticons_pack -version: 0.0.7 +version: 0.1 description: Install, update and view detailed legend of emoticons authors: Denis Fomin <fominde(a)gmail.com> homepage:
http://trac-plugins.gajim.org/wiki/
1
0
0
0
gajim-plugins: Use GTK Pixbuf as fallback for downsampling image...
by Gajim Plugins
08 Oct '15
08 Oct '15
changeset 3fb7dec776d0 in /home/hg/repos/gajim-plugins author: tmolitor <thilo(a)eightysoft.de> branches: details:gajim-plugins?cmd=changeset;node=3fb7dec776d0 description: Use GTK Pixbuf as fallback for downsampling images, if PIL is not available...some minor bugfixes in upload component detection... diffstat: httpupload/httpupload.py | 144 ++++++++++++++++++++++++++++++++++++++-------- httpupload/manifest.ini | 3 +- 2 Dateien ver?ndert, 119 Zeilen hinzugef?gt(+), 28 Zeilen entfernt(-) Unterschiede (257 Zeilen): diff -r 556489c4f110 -r 3fb7dec776d0 httpupload/httpupload.py --- a/httpupload/httpupload.py Thu Oct 08 15:46:38 2015 +0200 +++ b/httpupload/httpupload.py Thu Oct 08 15:54:46 2015 +0200 @@ -3,20 +3,23 @@ from common import demandimport demandimport.enable() -demandimport.ignore += ['builtins', '__builtin__'] +demandimport.ignore += ['builtins', '__builtin__', 'PIL'] import gtk import gobject import os +import time import base64 +import tempfile import urllib2 import mimetypes # better use the magic packet, but that's not a standard lib import gtkgui_helpers from Queue import Queue try: from PIL import Image + pil_available = True except: - pass + pil_available = False import StringIO import base64 @@ -28,15 +31,16 @@ from dialogs import FileChooserDialog, ImageChooserDialog, ErrorDialog import nbxmpp -#NS_HTTPUPLOAD = 'eu:siacs:conversations:http:upload' # old namespace before XEP publication NS_HTTPUPLOAD = 'urn:xmpp:http:upload' # XEP-0363 (
http://xmpp.org/extensions/xep-0363.html
) jid_to_servers = {} iq_ids_to_callbacks = {} +last_info_query = {} max_thumbnail_size = 2048 max_thumbnail_dimension = 160 class HttpuploadPlugin(GajimPlugin): + @log_calls('HttpuploadPlugin') def init(self): self.config_dialog = None # HttpuploadPluginConfigDialog(self) @@ -73,10 +77,40 @@ # update all buttons for base in self.controls: self.update_button_state(base.chat_control) - + @log_calls('HttpuploadPlugin') def connect_with_chat_control(self, control): + global jid_to_servers + global iq_ids_to_callbacks + global last_info_query self.chat_control = control + # query info at most every 300 seconds (5 minutes) in case something goes wrong + if (not self.chat_control.account in last_info_query or \ + last_info_query[self.chat_control.account] + 300 < time.time()) and \ + not gajim.get_jid_from_account(self.chat_control.account) in jid_to_servers and \ + gajim.account_is_connected(self.chat_control.account): + log.info("Account %s: Using dicovery to find jid of httpupload component" % self.chat_control.account) + id_ = gajim.get_an_id() + iq = nbxmpp.Iq( + typ='get', + to=gajim.get_server_from_jid(gajim.get_jid_from_account(self.chat_control.account)), + queryNS="
http://jabber.org/protocol/disco#items
" + ) + iq.setID(id_) + def query_info(stanza): + global last_info_query + for item in stanza.getTag("query").getTags("item"): + id_ = gajim.get_an_id() + iq = nbxmpp.Iq( + typ='get', + to=item.getAttr("jid"), + queryNS="
http://jabber.org/protocol/disco#info
" + ) + iq.setID(id_) + gajim.connections[control.account].connection.send(iq) + last_info_query[self.chat_control.account] = time.time() + iq_ids_to_callbacks[str(id_)] = query_info + gajim.connections[self.chat_control.account].connection.send(iq) base = Base(self, self.chat_control) self.controls.append(base) if self.first_run: @@ -85,6 +119,7 @@ gtk.keysyms.u, gtk.gdk.MOD1_MASK, 'mykeypress', int, gtk.keysyms.u, gtk.gdk.ModifierType, gtk.gdk.MOD1_MASK) self.first_run = False + self.update_button_state(self.chat_control) @log_calls('HttpuploadPlugin') def disconnect_from_chat_control(self, chat_control): @@ -98,7 +133,10 @@ if base.chat_control == chat_control: if gajim.connections[chat_control.account].connection == None and \ gajim.get_jid_from_account(chat_control.account) in jid_to_servers: + # maybe don't delete this and detect vanished upload components when actually trying to upload something + log.info("Deleting %s from jid_to_servers (disconnected)" % gajim.get_jid_from_account(chat_control.account)) del jid_to_servers[gajim.get_jid_from_account(chat_control.account)] + #pass is_supported = gajim.get_jid_from_account(chat_control.account) in jid_to_servers and \ gajim.connections[chat_control.account].connection != None if not is_supported: @@ -181,7 +219,8 @@ actions_hbox = self.chat_control.xml.get_object('actions_hbox') actions_hbox.remove(self.button) actions_hbox.remove(self.image_button) - if self.chat_control.handlers[self.keypress_id].handler_is_connected(self.keypress_id): + if self.keypress_id in self.chat_control.handlers and \ + self.chat_control.handlers[self.keypress_id].handler_is_connected(self.keypress_id): self.chat_control.handlers[self.keypress_id].disconnect(self.keypress_id) del self.chat_control.handlers[self.keypress_id] @@ -263,27 +302,57 @@ if (not isinstance(self.chat_control, chat_control.ChatControl) or not self.chat_control.gpg_is_active) and \ self.dialog_type == 'image' and is_image: progress_messages.put(_('Calculating (possible) image thumbnail...')) - try: - quality_steps = (100, 80, 60, 50, 40, 30, 25, 23, 20, 18, 15, 13, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1) - for quality in quality_steps: - thumb = Image.open(path_to_file) - thumb.thumbnail((max_thumbnail_dimension, max_thumbnail_dimension), Image.ANTIALIAS) - output = StringIO.StringIO() - thumb.save(output, format='JPEG', quality=quality, optimize=True) - thumb = output.getvalue() - output.close() - thumb = urllib2.quote(base64.standard_b64encode(thumb), '') - log.debug("thumbnail jpeg quality %d produces an image of size %d..." % (quality, len(thumb))) - if len(thumb) < max_thumbnail_size: - break - if len(thumb) > max_thumbnail_size: - log.info("Couldn't compress image enough, not sending any thumbnail") - else: - log.info("Using thumbnail jpeg quality %d (image size: %d bytes)" % (quality, len(thumb))) - xhtml = '<body><br/><a href="%s"> <img alt="%s" src="data:image/png;base64,%s"/> </a></body>' % \ - (get.getData(), get.getData(), thumb) - except: - pass + thumb = None + quality_steps = (100, 80, 60, 50, 40, 35, 30, 25, 23, 20, 18, 15, 13, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1) + if pil_available: + log.info("PIL available, using it for image downsampling") + try: + for quality in quality_steps: + thumb = Image.open(path_to_file) + thumb.thumbnail((max_thumbnail_dimension, max_thumbnail_dimension), Image.ANTIALIAS) + output = StringIO.StringIO() + thumb.save(output, format='JPEG', quality=quality, optimize=True) + thumb = output.getvalue() + output.close() + thumb = urllib2.quote(base64.standard_b64encode(thumb), '') + log.debug("thumbnail jpeg quality %d produces an image of size %d..." % (quality, len(thumb))) + if len(thumb) < max_thumbnail_size: + break + except: + thumb = None + else: + log.info("PIL not available, using GTK for image downsampling") + temp_file = None + try: + with open(path_to_file, 'rb') as content_file: + thumb = content_file.read() + loader = gtk.gdk.PixbufLoader() + loader.write(thumb) + loader.close() + pixbuf = loader.get_pixbuf() + scaled_pb = self.get_pixbuf_of_size(pixbuf, max_thumbnail_dimension) + handle, temp_file = tempfile.mkstemp(suffix='.jpeg', prefix='gajim_httpupload_scaled_tmp', dir=gajim.TMP) + log.debug("Saving temporary jpeg image to '%s'..." % temp_file) + os.close(handle) + for quality in quality_steps: + scaled_pb.save(temp_file, "jpeg", {"quality": str(quality)}) + with open(temp_file, 'rb') as content_file: + thumb = content_file.read() + thumb = urllib2.quote(base64.standard_b64encode(thumb), '') + log.debug("thumbnail jpeg quality %d produces an image of size %d..." % (quality, len(thumb))) + if len(thumb) < max_thumbnail_size: + break + except: + thumb = None + finally: + if temp_file: + os.unlink(temp_file) + if thumb and len(thumb) > max_thumbnail_size: + log.info("Couldn't compress image enough, not sending any thumbnail") + else: + log.info("Using thumbnail jpeg quality %d (image size: %d bytes)" % (quality, len(thumb))) + xhtml = '<body><br/><a href="%s"> <img alt="%s" src="data:image/png;base64,%s"/> </a></body>' % \ + (get.getData(), get.getData(), thumb) progress_window.close_dialog() self.chat_control.send_message(message=get.getData(), xhtml=xhtml) self.chat_control.msg_textview.grab_focus() @@ -322,10 +391,11 @@ is_supported = gajim.get_jid_from_account(self.chat_control.account) in jid_to_servers and \ gajim.connections[self.chat_control.account].connection != None + log.debug("jid_to_servers of %s: %s ; connection: %s" % (gajim.get_jid_from_account(self.chat_control.account), str(jid_to_servers[gajim.get_jid_from_account(self.chat_control.account)]), str(gajim.connections[self.chat_control.account].connection))) if not is_supported: progress_window.close_dialog() log.error("upload component vanished, account got disconnected??") - ErrorDialog(_('Your server does not support http uploads or you just got disconnected'), + ErrorDialog(_('Your server does not support http uploads or you just got disconnected.\nPlease try to reconnect or reopen the chat window to fix this.'), transient_for=self.chat_control.parent_win.window) return @@ -371,6 +441,26 @@ def on_image_button_clicked(self, widget): self.dialog_type = 'image' self.dlg = ImageChooserDialog(on_response_ok=self.on_file_dialog_ok, on_response_cancel=None) + + def get_pixbuf_of_size(self, pixbuf, size): + # Creates a pixbuf that fits in the specified square of sizexsize + # while preserving the aspect ratio + # Returns scaled_pixbuf + image_width = pixbuf.get_width() + image_height = pixbuf.get_height() + + if image_width > image_height: + if image_width > size: + image_height = int(size / float(image_width) * image_height) + image_width = int(size) + else: + if image_height > size: + image_width = int(size / float(image_height) * image_width) + image_height = int(size) + + crop_pixbuf = pixbuf.scale_simple(image_width, image_height, + gtk.gdk.INTERP_BILINEAR) + return crop_pixbuf class StreamFileWithProgress(file): diff -r 556489c4f110 -r 3fb7dec776d0 httpupload/manifest.ini --- a/httpupload/manifest.ini Thu Oct 08 15:46:38 2015 +0200 +++ b/httpupload/manifest.ini Thu Oct 08 15:54:46 2015 +0200 @@ -1,7 +1,7 @@ [info] name: HttpUpload short_name: httpupload -version: 0.2.11 +version: 0.3.1 description: This plugin is designed to send a file to a contact or muc by using httpupload.<br/> Your server must support <a href="
http://xmpp.org/extensions/xep-0363.html
">XEP-0363: HTTP Upload</a>.<br/> Conversations supported this.<br/> @@ -9,6 +9,7 @@ and maintains the scheme data: URI, a thumbnail image is send along the link to the full size image. If the receiving side doesn't support this, only a text message containing the link to the image is send. authors: Thilo Molitor <thilo(a)eightysoft.de> + Anders Sandblad <runeson(a)gmail.com> homepage:
https://trac-plugins.gajim.org/wiki/HttpUploadPlugin
min_gajim_version: 0.16.0 max_gajim_version: 0.16.9
1
0
0
0
← Newer
1
2
3
4
Older →
Jump to page:
1
2
3
4
Results per page:
10
25
50
100
200