From ef40b617349f49f3f7543b4647bb142590773bc5 Mon Sep 17 00:00:00 2001 From: fiaxh Date: Tue, 30 Jan 2018 17:29:54 +0100 Subject: Small fixes --- plugins/http-files/src/file_provider.vala | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'plugins/http-files') diff --git a/plugins/http-files/src/file_provider.vala b/plugins/http-files/src/file_provider.vala index 5737ebf8..b647cdbb 100644 --- a/plugins/http-files/src/file_provider.vala +++ b/plugins/http-files/src/file_provider.vala @@ -11,14 +11,12 @@ public class FileProvider : Dino.FileProvider, Object { private StreamInteractor stream_interactor; private Regex url_regex; - private Regex file_ext_regex; private Gee.List ignore_once = new ArrayList(); public FileProvider(StreamInteractor stream_interactor, Dino.Database dino_db) { this.stream_interactor = stream_interactor; this.url_regex = new Regex("""^(?i)\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))$"""); - this.file_ext_regex = new Regex("""\.(png|jpg|jpeg|svg|gif|pgp)$"""); stream_interactor.get_module(MessageProcessor.IDENTITY).received_pipeline.connect(new ReceivedMessageListener(this)); stream_interactor.get_module(Manager.IDENTITY).uploaded.connect((file_transfer, url) => { @@ -28,7 +26,7 @@ public class FileProvider : Dino.FileProvider, Object { private class ReceivedMessageListener : MessageListener { - public string[] after_actions_const = new string[]{ "" }; + public string[] after_actions_const = new string[]{ }; public override string action_group { get { return "DECRYPT"; } } public override string[] after_actions { get { return after_actions_const; } } @@ -47,7 +45,7 @@ public class FileProvider : Dino.FileProvider, Object { if (message.direction == Message.DIRECTION_RECEIVED && !in_roster) return false; string? oob_url = Xmpp.Xep.OutOfBandData.get_url_from_message(message.stanza); - if ((oob_url != null && oob_url == message.body) || outer.file_ext_regex.match(message.body)) { + if (oob_url != null && oob_url == message.body) { yield outer.download_url(message, conversation); } return false; -- cgit v1.2.3-70-g09d2