Fix a couple of typos and double imports

This commit is contained in:
hrxi 2019-06-01 17:09:26 +02:00
parent 6a1f057de2
commit c245f7e34a
8 changed files with 11 additions and 14 deletions

View file

@ -16,7 +16,7 @@ public class FileManager : StreamInteractionModule, Object {
private StreamInteractor stream_interactor; private StreamInteractor stream_interactor;
private Database db; private Database db;
private Gee.List<FileSender> file_senders = new ArrayList<FileSender>(); private Gee.List<FileSender> file_senders = new ArrayList<FileSender>();
public Gee.List<IncommingFileProcessor> incomming_processors = new ArrayList<IncommingFileProcessor>(); public Gee.List<IncomingFileProcessor> incoming_processors = new ArrayList<IncomingFileProcessor>();
private Gee.List<OutgoingFileProcessor> outgoing_processors = new ArrayList<OutgoingFileProcessor>(); private Gee.List<OutgoingFileProcessor> outgoing_processors = new ArrayList<OutgoingFileProcessor>();
public static void start(StreamInteractor stream_interactor, Database db) { public static void start(StreamInteractor stream_interactor, Database db) {
@ -116,7 +116,7 @@ public class FileManager : StreamInteractionModule, Object {
} }
public void add_provider(FileProvider file_provider) { public void add_provider(FileProvider file_provider) {
file_provider.file_incoming.connect((file_transfer, conversation) => { handle_incomming_file.begin(file_provider, file_transfer, conversation); }); file_provider.file_incoming.connect((file_transfer, conversation) => { handle_incoming_file.begin(file_provider, file_transfer, conversation); });
} }
public void add_sender(FileSender file_sender) { public void add_sender(FileSender file_sender) {
@ -126,8 +126,8 @@ public class FileManager : StreamInteractionModule, Object {
}); });
} }
public void add_incomming_processor(IncommingFileProcessor processor) { public void add_incoming_processor(IncomingFileProcessor processor) {
incomming_processors.add(processor); incoming_processors.add(processor);
} }
public void add_outgoing_processor(OutgoingFileProcessor processor) { public void add_outgoing_processor(OutgoingFileProcessor processor) {
@ -140,7 +140,7 @@ public class FileManager : StreamInteractionModule, Object {
return file_transfer.direction == FileTransfer.DIRECTION_SENT || in_roster; return file_transfer.direction == FileTransfer.DIRECTION_SENT || in_roster;
} }
private async void handle_incomming_file(FileProvider file_provider, FileTransfer file_transfer, Conversation conversation) { private async void handle_incoming_file(FileProvider file_provider, FileTransfer file_transfer, Conversation conversation) {
if (!is_sender_trustworthy(file_transfer, conversation)) return; if (!is_sender_trustworthy(file_transfer, conversation)) return;
if (file_transfer.size == -1) { if (file_transfer.size == -1) {
@ -192,7 +192,7 @@ public interface FileSender : Object {
public abstract void send_file(Conversation conversation, FileTransfer file_transfer); public abstract void send_file(Conversation conversation, FileTransfer file_transfer);
} }
public interface IncommingFileProcessor : Object { public interface IncomingFileProcessor : Object {
public abstract bool can_process(FileTransfer file_transfer); public abstract bool can_process(FileTransfer file_transfer);
public abstract void process(FileTransfer file_transfer); public abstract void process(FileTransfer file_transfer);
} }

View file

@ -103,7 +103,7 @@ public class FileProvider : Dino.FileProvider, Object {
file_transfer.input_stream = yield request.send_async(null); file_transfer.input_stream = yield request.send_async(null);
foreach (IncommingFileProcessor processor in stream_interactor.get_module(FileManager.IDENTITY).incomming_processors) { foreach (IncomingFileProcessor processor in stream_interactor.get_module(FileManager.IDENTITY).incoming_processors) {
if (processor.can_process(file_transfer)) { if (processor.can_process(file_transfer)) {
processor.process(file_transfer); processor.process(file_transfer);
} }

View file

@ -1,6 +1,5 @@
using Gee; using Gee;
using Xmpp; using Xmpp;
using Xmpp;
using Xmpp.Xep; using Xmpp.Xep;
using Signal; using Signal;

View file

@ -2,7 +2,7 @@ using Dino.Entities;
namespace Dino.Plugins.OpenPgp { namespace Dino.Plugins.OpenPgp {
public class InFileProcessor : IncommingFileProcessor, Object { public class InFileProcessor : IncomingFileProcessor, Object {
public bool can_process(FileTransfer file_transfer) { public bool can_process(FileTransfer file_transfer) {
return file_transfer.file_name.has_suffix("pgp") || file_transfer.mime_type == "application/pgp-encrypted"; return file_transfer.file_name.has_suffix("pgp") || file_transfer.mime_type == "application/pgp-encrypted";
} }

View file

@ -30,7 +30,7 @@ public class Plugin : Plugins.RootInterface, Object {
Manager.start(app.stream_interactor, db); Manager.start(app.stream_interactor, db);
app.stream_interactor.get_module(FileManager.IDENTITY).add_outgoing_processor(new OutFileProcessor(app.stream_interactor)); app.stream_interactor.get_module(FileManager.IDENTITY).add_outgoing_processor(new OutFileProcessor(app.stream_interactor));
app.stream_interactor.get_module(FileManager.IDENTITY).add_incomming_processor(new InFileProcessor()); app.stream_interactor.get_module(FileManager.IDENTITY).add_incoming_processor(new InFileProcessor());
internationalize(GETTEXT_PACKAGE, app.search_path_generator.get_locale_path(GETTEXT_PACKAGE, LOCALE_INSTALL_DIR)); internationalize(GETTEXT_PACKAGE, app.search_path_generator.get_locale_path(GETTEXT_PACKAGE, LOCALE_INSTALL_DIR));
} }

View file

@ -1,6 +1,5 @@
using Gee; using Gee;
using Xmpp;
using Xmpp; using Xmpp;
namespace Dino.Plugins.OpenPgp { namespace Dino.Plugins.OpenPgp {

View file

@ -1,5 +1,4 @@
using Xmpp; using Xmpp;
using Xmpp;
using Xmpp.Xep; using Xmpp.Xep;
namespace Xmpp.Xep.HttpFileUpload { namespace Xmpp.Xep.HttpFileUpload {