aboutsummaryrefslogtreecommitdiff
path: root/libdino/src/plugin/registry.vala
diff options
context:
space:
mode:
authorfiaxh <git@mx.ax.lt>2017-08-27 23:55:49 +0200
committerfiaxh <git@mx.ax.lt>2017-08-28 00:02:59 +0200
commit8bc0d107e740be468ee0c9dcd253de36355088d3 (patch)
tree36858e844d711eb18a68612fd815cb84f4c3a88f /libdino/src/plugin/registry.vala
parenta807ded65cd907e04bab7b8cd27b5702b157e3a2 (diff)
downloaddino-8bc0d107e740be468ee0c9dcd253de36355088d3.tar.gz
dino-8bc0d107e740be468ee0c9dcd253de36355088d3.zip
Plugins providing conversation items for ConversationView
Diffstat (limited to 'libdino/src/plugin/registry.vala')
-rw-r--r--libdino/src/plugin/registry.vala22
1 files changed, 22 insertions, 0 deletions
diff --git a/libdino/src/plugin/registry.vala b/libdino/src/plugin/registry.vala
index 6284269b..7b4410aa 100644
--- a/libdino/src/plugin/registry.vala
+++ b/libdino/src/plugin/registry.vala
@@ -7,6 +7,8 @@ public class Registry {
internal ArrayList<AccountSettingsEntry> account_settings_entries = new ArrayList<AccountSettingsEntry>();
internal ArrayList<ContactDetailsProvider> contact_details_entries = new ArrayList<ContactDetailsProvider>();
internal Map<string, TextCommand> text_commands = new HashMap<string, TextCommand>();
+ internal Gee.List<MessageDisplayProvider> message_displays = new ArrayList<MessageDisplayProvider>();
+ internal Gee.List<ConversationItemPopulator> conversation_item_populators = new ArrayList<ConversationItemPopulator>();
internal Gee.Collection<ConversationTitlebarEntry> conversation_titlebar_entries = new Gee.TreeSet<ConversationTitlebarEntry>((a, b) => {
if (a.order < b.order) {
return -1;
@@ -67,6 +69,26 @@ public class Registry {
return true;
}
}
+
+ public bool register_message_display(MessageDisplayProvider provider) {
+ lock (message_displays) {
+ foreach(MessageDisplayProvider p in message_displays) {
+ if (p.id == provider.id) return false;
+ }
+ message_displays.add(provider);
+ return true;
+ }
+ }
+
+ public bool register_conversation_item_populator(ConversationItemPopulator populator) {
+ lock (conversation_item_populators) {
+ foreach(ConversationItemPopulator p in conversation_item_populators) {
+ if (p.id == populator.id) return false;
+ }
+ conversation_item_populators.add(populator);
+ return true;
+ }
+ }
}
}