2017-08-02 15:29:55 +00:00
|
|
|
extern const string GETTEXT_PACKAGE;
|
|
|
|
extern const string LOCALE_INSTALL_DIR;
|
|
|
|
|
|
|
|
namespace Dino.Plugins.HttpFiles {
|
|
|
|
|
|
|
|
public class Plugin : RootInterface, Object {
|
|
|
|
|
|
|
|
public Dino.Application app;
|
2017-08-29 22:03:37 +00:00
|
|
|
public FileProvider file_provider;
|
2017-08-02 15:29:55 +00:00
|
|
|
|
|
|
|
public void registered(Dino.Application app) {
|
|
|
|
try {
|
|
|
|
this.app = app;
|
2017-10-22 15:24:16 +00:00
|
|
|
Manager.start(this.app.stream_interactor, app.db);
|
2017-08-29 22:03:37 +00:00
|
|
|
|
|
|
|
file_provider = new FileProvider(app.stream_interactor, app.db);
|
2017-08-02 15:29:55 +00:00
|
|
|
|
2017-08-29 22:03:37 +00:00
|
|
|
app.stream_interactor.module_manager.initialize_account_modules.connect((account, list) => {
|
2017-08-02 15:29:55 +00:00
|
|
|
list.add(new UploadStreamModule());
|
|
|
|
});
|
2017-08-29 22:03:37 +00:00
|
|
|
|
|
|
|
app.stream_interactor.get_module(FileManager.IDENTITY).add_provider(file_provider);
|
2017-10-14 17:34:30 +00:00
|
|
|
app.plugin_registry.register_message_display(new FileMessageFilterDisplay(app.db));
|
2017-08-02 15:29:55 +00:00
|
|
|
} catch (Error e) {
|
|
|
|
print(@"Error initializing http-files: $(e.message)\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public void shutdown() {
|
|
|
|
// Nothing to do
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|