aboutsummaryrefslogtreecommitdiff
path: root/plugins/http-files/src/manager.vala
diff options
context:
space:
mode:
authorbobufa <bobufa@users.noreply.github.com>2018-06-19 18:07:00 +0200
committerbobufa <bobufa@users.noreply.github.com>2018-08-13 22:04:47 +0200
commit3ea00446fb5893804243f5b1a1aa89817b7bc19a (patch)
tree3be25cfd7b807cd6db4846e6fe1b6e404a58a1f4 /plugins/http-files/src/manager.vala
parentab0bc7f04d156db9e398c3f8c4f8bdfc11dd7458 (diff)
downloaddino-3ea00446fb5893804243f5b1a1aa89817b7bc19a.tar.gz
dino-3ea00446fb5893804243f5b1a1aa89817b7bc19a.zip
refactor conversation item management (accumulate them in libdino)
Diffstat (limited to 'plugins/http-files/src/manager.vala')
-rw-r--r--plugins/http-files/src/manager.vala19
1 files changed, 8 insertions, 11 deletions
diff --git a/plugins/http-files/src/manager.vala b/plugins/http-files/src/manager.vala
index 7335b89a..78c244e3 100644
--- a/plugins/http-files/src/manager.vala
+++ b/plugins/http-files/src/manager.vala
@@ -81,22 +81,19 @@ public class Manager : StreamInteractionModule, FileSender, Object {
}
}
-public class FileMessageFilterDisplay : Plugins.MessageDisplayProvider, Object {
- public string id { get; set; default="file_message_filter"; }
- public double priority { get; set; default=10; }
-
+public class FileMessageFilter : ContentFilter, Object {
public Database db;
- public FileMessageFilterDisplay(Dino.Database db) {
+ public FileMessageFilter(Dino.Database db) {
this.db = db;
}
- public bool can_display(Entities.Message? message) {
- return message_is_file(db, message);
- }
-
- public Plugins.MetaConversationItem? get_item(Entities.Message message, Conversation conversation) {
- return null;
+ public bool discard(ContentItem content_item) {
+ if (content_item.type_ == MessageItem.TYPE) {
+ MessageItem message_item = content_item as MessageItem;
+ return message_is_file(db, message_item.message);
+ }
+ return false;
}
}