From 781d241b93c1d7696cafa524f0c6e00d84579951 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Sat, 13 May 2017 17:45:06 +0200 Subject: add plugin api for text commands --- libdino/src/plugin/registry.vala | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'libdino/src/plugin') 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 encryption_list_entries = new ArrayList(); internal ArrayList account_settings_entries = new ArrayList(); internal ArrayList contact_details_entries = new ArrayList(); + internal Map text_commands = new HashMap(); internal Gee.Collection conversation_titlebar_entries = new Gee.TreeSet((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) { -- cgit v1.2.3-70-g09d2