Commit 0a48fac5 authored by Philipp Hörist's avatar Philipp Hörist

Move uri_schemes to const module

parent b4c10c71
......@@ -994,3 +994,93 @@ SHOW_LIST = [
'dnd',
'error'
]
URI_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:',
'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://',
'aesgcm://',
}
......@@ -149,7 +149,6 @@ APP_SETTINGS = {
'scroll_roster_to_last_message': True,
'change_status_window_timeout': 15,
'max_conversation_lines': 500,
'uri_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: 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:// aesgcm://',
'shell_like_completion': False,
'audio_input_device': 'autoaudiosrc ! volume name=gajim_vol',
'audio_output_device': 'autoaudiosink',
......@@ -444,7 +443,6 @@ ADVANCED_SETTINGS = {
'scroll_roster_to_last_message': _('If enabled, Gajim will scroll and select the contact who sent you the last message, if the chat window is not already opened.'),
'change_status_window_timeout': _('Time of inactivity needed before the change status window closes down.'),
'max_conversation_lines': _('Maximum number of lines that are printed in conversations. Oldest lines are cleared.'),
'uri_schemes': _('Valid URI schemes. Only schemes in this list will be accepted as \'real\' URI (mailto and xmpp are handled separately).'),
'shell_like_completion': _('If enabled, completion in group chats will be like a shell auto-completion.'),
'use_stun_server': _('If enabled, Gajim will try to use a STUN server when using Jingle. The one in \'stun_server\' option, or the one given by the XMPP server.'),
'stun_server': _('STUN server to use when using Jingle'),
......
......@@ -41,6 +41,7 @@ from gajim.common.i18n import _
from gajim.common.helpers import AdditionalDataDict
from gajim.common.const import StyleAttr
from gajim.common.const import Trust
from gajim.common.const import URI_SCHEMES
from gajim.common.helpers import to_user_string
from gajim.gtk import util
......@@ -642,8 +643,7 @@ class ConversationTextview(GObject.GObject):
break
# Check if we accept this as an uri
schemes = app.settings.get('uri_schemes').split()
for scheme in schemes:
for scheme in URI_SCHEMES:
if special_text.startswith(scheme):
text_is_valid_uri = True
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment