aboutsummaryrefslogtreecommitdiff
path: root/libdino/src/plugin
diff options
context:
space:
mode:
Diffstat (limited to 'libdino/src/plugin')
-rw-r--r--libdino/src/plugin/interfaces.vala26
-rw-r--r--libdino/src/plugin/registry.vala21
2 files changed, 10 insertions, 37 deletions
diff --git a/libdino/src/plugin/interfaces.vala b/libdino/src/plugin/interfaces.vala
index 09d4d921..01cd525a 100644
--- a/libdino/src/plugin/interfaces.vala
+++ b/libdino/src/plugin/interfaces.vala
@@ -75,11 +75,13 @@ public interface ConversationTitlebarWidget : Object {
public abstract interface ConversationItemPopulator : Object {
public abstract string id { get; }
public abstract void init(Conversation conversation, ConversationItemCollection summary, WidgetType type);
- public virtual void populate_timespan(Conversation conversation, DateTime from, DateTime to) { }
- public virtual void populate_between_widgets(Conversation conversation, DateTime from, DateTime to) { }
public abstract void close(Conversation conversation);
}
+public abstract interface ConversationAdditionPopulator : ConversationItemPopulator {
+ public virtual void populate_timespan(Conversation conversation, DateTime from, DateTime to) { }
+}
+
public abstract interface NotificationPopulator : Object {
public abstract string id { get; }
public abstract void init(Conversation conversation, NotificationCollection summary, WidgetType type);
@@ -87,9 +89,8 @@ public abstract interface NotificationPopulator : Object {
}
public abstract class MetaConversationItem : Object {
+ public virtual string populator_id { get; set; }
public virtual Jid? jid { get; set; default=null; }
- public virtual string color { get; set; default=null; }
- public virtual string display_name { get; set; default=null; }
public virtual bool dim { get; set; default=false; }
public virtual DateTime? sort_time { get; set; default=null; }
public virtual double seccondary_sort_indicator { get; set; }
@@ -118,21 +119,4 @@ public interface NotificationCollection : Object {
public signal void remove_meta_notification(MetaConversationNotification item);
}
-public interface MessageDisplayProvider : Object {
- public abstract string id { get; set; }
- public abstract double priority { get; set; }
- public abstract bool can_display(Entities.Message? message);
- public abstract MetaConversationItem? get_item(Entities.Message message, Entities.Conversation conversation);
-}
-
-public interface FileWidget : Object {
- public abstract Object? get_widget(WidgetType type);
-}
-
-public interface FileDisplayProvider : Object {
- public abstract double priority { get; }
- public abstract bool can_display(Entities.Message? message);
- public abstract FileWidget? get_item(Entities.Message? message);
-}
-
}
diff --git a/libdino/src/plugin/registry.vala b/libdino/src/plugin/registry.vala
index fbdf2c5c..9c211a6d 100644
--- a/libdino/src/plugin/registry.vala
+++ b/libdino/src/plugin/registry.vala
@@ -7,8 +7,7 @@ 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.List<ConversationAdditionPopulator> conversation_addition_populators = new ArrayList<ConversationAdditionPopulator>();
internal Gee.List<NotificationPopulator> notification_populators = new ArrayList<NotificationPopulator>();
internal Gee.Collection<ConversationTitlebarEntry> conversation_titlebar_entries = new Gee.TreeSet<ConversationTitlebarEntry>((a, b) => {
if (a.order < b.order) {
@@ -71,22 +70,12 @@ public class Registry {
}
}
- 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) {
+ public bool register_conversation_addition_populator(ConversationAdditionPopulator populator) {
+ lock (conversation_addition_populators) {
+ foreach(ConversationItemPopulator p in conversation_addition_populators) {
if (p.id == populator.id) return false;
}
- conversation_item_populators.add(populator);
+ conversation_addition_populators.add(populator);
return true;
}
}