handle URI in a better way. some require ://, some only :. Fixes #5841

This commit is contained in:
Yann Leboulanger 2010-08-15 21:51:40 +02:00
parent 6a6143f8fb
commit 4ef341bf2e
5 changed files with 11 additions and 4 deletions

View File

@ -1,5 +1,5 @@
#!/usr/bin/env bash
gajimversion="0.13.90"
gajimversion="0.13.90.1"
if [ -d ".hg" ]; then
hgversion="-$(hexdump -n6 -e'6/1 "%02x"' .hg/dirstate)"
else

View File

@ -270,7 +270,7 @@ class Config:
'attach_notifications_to_systray': [opt_bool, False, _('If True, notification windows from notification-daemon will be attached to systray icon.')],
'check_idle_every_foo_seconds': [opt_int, 2, _('Choose interval between 2 checks of idleness.')],
'latex_png_dpi': [opt_str, '108', _('Change the value to change the size of latex formulas displayed. The higher is larger.') ],
'uri_schemes': [opt_str, 'aaa aaas acap cap cid crid data dav dict dns fax file ftp go gopher h323 http https icap im imap info ipp iris iris.beep iris.xpc iris.xpcs iris.lwz ldap mid modem msrp msrps mtqp mupdate news nfs nntp opaquelocktoken pop pres rtsp service shttp sip sips snmp soap.beep soap.beeps tag tel telnet tftp thismessage tip tv urn vemmi xmlrpc.beep xmlrpc.beeps z39.50r z39.50s about cvs daap ed2k feed fish git iax2 irc ircs ldaps magnet mms rsync ssh svn sftp smb webcal', _('Valid uri schemes. Only schemes in this list will be accepted as "real" uri. (mailto and xmpp are handled separately)'), True],
'uri_schemes': [opt_str, 'aaa:// aaas:// acap:// cap:// cid: crid:// data: dav: dict:// dns: fax: file:/ ftp:// geo: go: gopher:// h323: http:// https:// iax: icap:// im: imap:// info: ipp:// iris: iris.beep: iris.xpc: iris.xpcs: iris.lwz: ldap:// mid: modem: msrp:// msrps:// mtqp:// mupdate:// news: nfs:// nntp:// opaquelocktoken: pop:// pres: prospero:// rtsp:// service: shttp:// sip: sips: sms: snmp:// soap.beep:// soap.beeps:// tag: tel: telnet:// tftp:// thismessage:/ tip:// tv: urn:// vemmi:// xmlrpc.beep:// xmlrpc.beeps:// z39.50r:// z39.50s:// about: apt: cvs:// daap:// ed2k:// feed: fish:// git:// iax2: irc:// ircs:// ldaps:// magnet: mms:// rsync:// ssh:// svn:// sftp:// smb:// webcal://', _('Valid uri schemes. Only schemes in this list will be accepted as "real" uri. (mailto and xmpp are handled separately)'), True],
'ask_offline_status_on_connection': [ opt_bool, False, _('Ask offline status message to all offline contacts when connection to an accoutn is established. WARNING: This causes a lot of requests to be sent!') ],
'shell_like_completion': [ opt_bool, False, _('If True, completion in groupchats will be like a shell auto-completion')],
'show_self_contact': [opt_str, 'when_other_resource', _('When is self contact row displayed. Can be "always", "when_other_resource" or "never"'), True],

View File

@ -27,7 +27,7 @@ docdir = '../'
basedir = '../'
localedir = '../po'
version = '0.13.90'
version = '0.13.90.1'
import subprocess
try:
hgversion = subprocess.Popen('hexdump -n6 -e\'6/1 "%02x"\' ../.hg/dirstate',

View File

@ -220,6 +220,8 @@ class OptionsParser:
self.update_config_to_013100()
if old < [0, 13, 10, 1] and new >= [0, 13, 10, 1]:
self.update_config_to_013101()
if old < [0, 13, 90, 1] and new >= [0, 13, 90, 1]:
self.update_config_to_013901()
gajim.logger.init_vars()
gajim.logger.attach_cache_database()
@ -886,3 +888,8 @@ class OptionsParser:
pass
con.close()
gajim.config.set('version', '0.13.10.1')
def update_config_to_013901(self):
schemes = 'aaa:// aaas:// acap:// cap:// cid: crid:// data: dav: dict:// dns: fax: file:/ ftp:// geo: go: gopher:// h323: http:// https:// iax: icap:// im: imap:// info: ipp:// iris: iris.beep: iris.xpc: iris.xpcs: iris.lwz: ldap:// mid: modem: msrp:// msrps:// mtqp:// mupdate:// news: nfs:// nntp:// opaquelocktoken: pop:// pres: prospero:// rtsp:// service: shttp:// sip: sips: sms: snmp:// soap.beep:// soap.beeps:// tag: tel: telnet:// tftp:// thismessage:/ tip:// tv: urn:// vemmi:// xmlrpc.beep:// xmlrpc.beeps:// z39.50r:// z39.50s:// about: apt: cvs:// daap:// ed2k:// feed: fish:// git:// iax2: irc:// ircs:// ldaps:// magnet: mms:// rsync:// ssh:// svn:// sftp:// smb:// webcal://'
gajim.config.set('uri_schemes', schemes)
gajim.config.set('version', '0.13.90.1')

View File

@ -1042,7 +1042,7 @@ class ConversationTextview(gobject.GObject):
# Check if we accept this as an uri
schemes = gajim.config.get('uri_schemes').split()
for scheme in schemes:
if special_text.startswith(scheme + ':'):
if special_text.startswith(scheme):
text_is_valid_uri = True
possible_emot_ascii_caps = special_text.upper() # emoticons keys are CAPS