aboutsummaryrefslogtreecommitdiff
path: root/libdino
diff options
context:
space:
mode:
Diffstat (limited to 'libdino')
-rw-r--r--libdino/src/plugin/interfaces.vala4
-rw-r--r--libdino/src/service/muc_manager.vala30
-rw-r--r--libdino/src/service/notification_events.vala2
3 files changed, 35 insertions, 1 deletions
diff --git a/libdino/src/plugin/interfaces.vala b/libdino/src/plugin/interfaces.vala
index 1b2033d9..20aa6c83 100644
--- a/libdino/src/plugin/interfaces.vala
+++ b/libdino/src/plugin/interfaces.vala
@@ -149,11 +149,13 @@ public class InputFieldStatus : Object {
public string? message;
public MessageType message_type;
public InputState input_state;
+ public bool contains_markup;
- public InputFieldStatus(string? message, MessageType message_type, InputState input_state) {
+ public InputFieldStatus(string? message, MessageType message_type, InputState input_state, bool contains_markup = false) {
this.message = message;
this.message_type = message_type;
this.input_state = input_state;
+ this.contains_markup = contains_markup;
}
}
diff --git a/libdino/src/service/muc_manager.vala b/libdino/src/service/muc_manager.vala
index 93814625..15f32c44 100644
--- a/libdino/src/service/muc_manager.vala
+++ b/libdino/src/service/muc_manager.vala
@@ -14,6 +14,8 @@ public class MucManager : StreamInteractionModule, Object {
public signal void room_info_updated(Account account, Jid muc_jid);
public signal void private_room_occupant_updated(Account account, Jid room, Jid occupant);
public signal void invite_received(Account account, Jid room_jid, Jid from_jid, string? password, string? reason);
+ public signal void voice_request_received(Account account, Jid room_jid, Jid from_jid, string? nick, string? role, string? label);
+ public signal void received_occupant_role(Account account, Jid jid, Xep.Muc.Role? role);
public signal void bookmarks_updated(Account account, Set<Conference> conferences);
public signal void conference_added(Account account, Conference conference);
public signal void conference_removed(Account account, Jid jid);
@@ -118,6 +120,16 @@ public class MucManager : StreamInteractionModule, Object {
if (stream != null) stream.get_module(Xep.Muc.Module.IDENTITY).change_affiliation(stream, jid.bare_jid, nick, role);
}
+ public void change_role(Account account, Jid jid, string nick, string role) {
+ XmppStream? stream = stream_interactor.get_stream(account);
+ if (stream != null) stream.get_module(Xep.Muc.Module.IDENTITY).change_role(stream, jid.bare_jid, nick, role);
+ }
+
+ public void request_voice(Account account, Jid jid) {
+ XmppStream? stream = stream_interactor.get_stream(account);
+ if (stream != null) stream.get_module(Xep.Muc.Module.IDENTITY).request_voice(stream, jid.bare_jid);
+ }
+
public bool kick_possible(Account account, Jid occupant) {
XmppStream? stream = stream_interactor.get_stream(account);
if (stream != null) return stream.get_module(Xep.Muc.Module.IDENTITY).kick_possible(stream, occupant);
@@ -137,6 +149,18 @@ public class MucManager : StreamInteractionModule, Object {
return flag.has_room_feature(jid, Xep.Muc.Feature.NON_ANONYMOUS) && flag.has_room_feature(jid, Xep.Muc.Feature.MEMBERS_ONLY);
}
+ public bool is_moderated_room(Account account, Jid jid) {
+ XmppStream? stream = stream_interactor.get_stream(account);
+ if (stream == null) {
+ return false;
+ }
+ Xep.Muc.Flag? flag = stream.get_flag(Xep.Muc.Flag.IDENTITY);
+ if (flag == null) {
+ return false;
+ }
+ return flag.has_room_feature(jid, Xep.Muc.Feature.MODERATED);
+ }
+
public bool is_public_room(Account account, Jid jid) {
return is_groupchat(jid, account) && !is_private_room(account, jid);
}
@@ -285,6 +309,12 @@ public class MucManager : StreamInteractionModule, Object {
stream_interactor.module_manager.get_module(account, Xep.Muc.Module.IDENTITY).invite_received.connect( (stream, room_jid, from_jid, password, reason) => {
invite_received(account, room_jid, from_jid, password, reason);
});
+ stream_interactor.module_manager.get_module(account, Xep.Muc.Module.IDENTITY).voice_request_received.connect( (stream, room_jid, from_jid, nick, role, label) => {
+ voice_request_received(account, room_jid, from_jid, nick, role, label);
+ });
+ stream_interactor.module_manager.get_module(account, Xep.Muc.Module.IDENTITY).received_occupant_role.connect( (stream, from_jid, role) => {
+ received_occupant_role(account, from_jid, role);
+ });
stream_interactor.module_manager.get_module(account, Xep.Muc.Module.IDENTITY).room_info_updated.connect( (stream, muc_jid) => {
room_info_updated(account, muc_jid);
});
diff --git a/libdino/src/service/notification_events.vala b/libdino/src/service/notification_events.vala
index 54206e99..3f4e3c6d 100644
--- a/libdino/src/service/notification_events.vala
+++ b/libdino/src/service/notification_events.vala
@@ -13,6 +13,7 @@ public class NotificationEvents : StreamInteractionModule, Object {
public signal void notify_subscription_request(Conversation conversation);
public signal void notify_connection_error(Account account, ConnectionManager.ConnectionError error);
public signal void notify_muc_invite(Account account, Jid room_jid, Jid from_jid, string? password, string? reason);
+ public signal void notify_voice_request(Account account, Jid room_jid, Jid from_jid, string? nick, string? role, string? label);
private StreamInteractor stream_interactor;
@@ -27,6 +28,7 @@ public class NotificationEvents : StreamInteractionModule, Object {
stream_interactor.get_module(ContentItemStore.IDENTITY).new_item.connect(on_content_item_received);
stream_interactor.get_module(PresenceManager.IDENTITY).received_subscription_request.connect(on_received_subscription_request);
stream_interactor.get_module(MucManager.IDENTITY).invite_received.connect((account, room_jid, from_jid, password, reason) => notify_muc_invite(account, room_jid, from_jid, password, reason));
+ stream_interactor.get_module(MucManager.IDENTITY).voice_request_received.connect((account, room_jid, from_jid, nick, role, label) => notify_voice_request(account, room_jid, from_jid, nick, role, label));
stream_interactor.connection_manager.connection_error.connect((account, error) => notify_connection_error(account, error));
}