aboutsummaryrefslogtreecommitdiff
path: root/libdino
diff options
context:
space:
mode:
Diffstat (limited to 'libdino')
-rw-r--r--libdino/src/plugin/interfaces.vala17
-rw-r--r--libdino/src/plugin/registry.vala11
-rw-r--r--libdino/src/service/muc_manager.vala10
3 files changed, 36 insertions, 2 deletions
diff --git a/libdino/src/plugin/interfaces.vala b/libdino/src/plugin/interfaces.vala
index 35c93786..705cdfe1 100644
--- a/libdino/src/plugin/interfaces.vala
+++ b/libdino/src/plugin/interfaces.vala
@@ -1,5 +1,7 @@
using Gtk;
+using Dino.Entities;
+
namespace Dino.Plugins {
public enum Priority {
@@ -20,7 +22,7 @@ public interface EncryptionListEntry : Object {
public abstract Entities.Encryption encryption { get; }
public abstract string name { get; }
- public abstract bool can_encrypt(Entities.Conversation conversation);
+ public abstract bool can_encrypt(Conversation conversation);
}
public abstract class AccountSettingsEntry : Object {
@@ -33,11 +35,22 @@ public abstract class AccountSettingsEntry : Object {
}
public interface AccountSettingsWidget : Gtk.Widget {
- public abstract void set_account(Entities.Account account);
+ public abstract void set_account(Account account);
public abstract signal void activated();
public abstract void deactivate();
}
+public abstract class ContactDetailsProvider : Object {
+ public abstract string id { get; }
+
+ public abstract void populate(Conversation conversation, ContactDetails contact_details);
+}
+
+public class ContactDetails : Object {
+ public signal void save();
+ public signal void add(string category, string label, string desc, Widget widget);
+}
+
} \ No newline at end of file
diff --git a/libdino/src/plugin/registry.vala b/libdino/src/plugin/registry.vala
index 27cac6f3..e1ba605d 100644
--- a/libdino/src/plugin/registry.vala
+++ b/libdino/src/plugin/registry.vala
@@ -5,6 +5,7 @@ namespace Dino.Plugins {
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>();
public bool register_encryption_list_entry(EncryptionListEntry entry) {
lock(encryption_list_entries) {
@@ -28,6 +29,16 @@ public class Registry {
return true;
}
}
+
+ public bool register_contact_details_entry(ContactDetailsProvider entry) {
+ lock(contact_details_entries) {
+ foreach(ContactDetailsProvider e in contact_details_entries) {
+ if (e.id == entry.id) return false;
+ }
+ contact_details_entries.add(entry);
+ return true;
+ }
+ }
}
} \ No newline at end of file
diff --git a/libdino/src/service/muc_manager.vala b/libdino/src/service/muc_manager.vala
index bf9b4cda..71a66bb4 100644
--- a/libdino/src/service/muc_manager.vala
+++ b/libdino/src/service/muc_manager.vala
@@ -45,6 +45,16 @@ public class MucManager : StreamInteractionModule, Object {
if (conversation != null) stream_interactor.get_module(ConversationManager.IDENTITY).close_conversation(conversation);
}
+ [CCode (has_target = false)] public delegate void OnResult(Jid jid, Xep.DataForms.DataForm data_form, Object? store);
+ public void get_config_form(Account account, Jid jid, OnResult on_result, Object? store) {
+ Core.XmppStream stream = stream_interactor.get_stream(account);
+ if (stream == null) return;
+ stream.get_module(Xep.Muc.Module.IDENTITY).get_config_form(stream, jid.to_string(), (stream, jid, data_form, store) => {
+ Tuple<OnResult, Object?> tuple = store as Tuple<OnResult, Object?>;
+ tuple.a(new Jid(jid), data_form, tuple.b);
+ }, Tuple.create(on_result, store));
+ }
+
public void change_subject(Account account, Jid jid, string subject) {
Core.XmppStream stream = stream_interactor.get_stream(account);
if (stream != null) stream.get_module(Xep.Muc.Module.IDENTITY).change_subject(stream, jid.bare_jid.to_string(), subject);