aboutsummaryrefslogtreecommitdiff
path: root/libdino/src/plugin
diff options
context:
space:
mode:
authorMarvin W <git@larma.de>2017-05-13 17:45:06 +0200
committerMarvin W <git@larma.de>2017-08-17 19:56:10 +0200
commit781d241b93c1d7696cafa524f0c6e00d84579951 (patch)
tree2a97ff9327b225f91ae9ef131b9235dafda3fdc5 /libdino/src/plugin
parent5dc460fc1a72a3dfe83453f4c6683be20a1a2a2d (diff)
downloaddino-781d241b93c1d7696cafa524f0c6e00d84579951.tar.gz
dino-781d241b93c1d7696cafa524f0c6e00d84579951.zip
add plugin api for text commands
Diffstat (limited to 'libdino/src/plugin')
-rw-r--r--libdino/src/plugin/registry.vala9
1 files changed, 9 insertions, 0 deletions
diff --git a/libdino/src/plugin/registry.vala b/libdino/src/plugin/registry.vala
index 01d18d5f..6284269b 100644
--- a/libdino/src/plugin/registry.vala
+++ b/libdino/src/plugin/registry.vala
@@ -6,6 +6,7 @@ public class Registry {
internal ArrayList<EncryptionListEntry> encryption_list_entries = new ArrayList<EncryptionListEntry>();
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.Collection<ConversationTitlebarEntry> conversation_titlebar_entries = new Gee.TreeSet<ConversationTitlebarEntry>((a, b) => {
if (a.order < b.order) {
return -1;
@@ -49,6 +50,14 @@ public class Registry {
}
}
+ public bool register_text_command(TextCommand cmd) {
+ lock(text_commands) {
+ if (text_commands.has_key(cmd.cmd)) return false;
+ text_commands[cmd.cmd] = cmd;
+ return true;
+ }
+ }
+
public bool register_contact_titlebar_entry(ConversationTitlebarEntry entry) {
lock(conversation_titlebar_entries) {
foreach(ConversationTitlebarEntry e in conversation_titlebar_entries) {