aboutsummaryrefslogtreecommitdiff
path: root/libdino
diff options
context:
space:
mode:
Diffstat (limited to 'libdino')
-rw-r--r--libdino/src/service/conversation_manager.vala9
-rw-r--r--libdino/src/service/file_manager.vala4
-rw-r--r--libdino/src/service/jingle_file_transfers.vala2
-rw-r--r--libdino/src/service/muc_manager.vala4
-rw-r--r--libdino/src/service/notification_events.vala4
5 files changed, 19 insertions, 4 deletions
diff --git a/libdino/src/service/conversation_manager.vala b/libdino/src/service/conversation_manager.vala
index 039bad53..10ba5f6d 100644
--- a/libdino/src/service/conversation_manager.vala
+++ b/libdino/src/service/conversation_manager.vala
@@ -26,6 +26,7 @@ public class ConversationManager : StreamInteractionModule, Object {
this.stream_interactor = stream_interactor;
stream_interactor.add_module(this);
stream_interactor.account_added.connect(on_account_added);
+ stream_interactor.account_removed.connect(on_account_removed);
stream_interactor.get_module(MessageProcessor.IDENTITY).received_pipeline.connect(new MessageListener(stream_interactor));
stream_interactor.get_module(MessageProcessor.IDENTITY).message_sent.connect(handle_sent_message);
}
@@ -136,6 +137,14 @@ public class ConversationManager : StreamInteractionModule, Object {
}
}
+ private void on_account_removed(Account account) {
+ foreach (Gee.List<Conversation> list in conversations[account].values) {
+ foreach (var conversation in list) {
+ if(conversation.active) conversation_deactivated(conversation);
+ }
+ }
+ }
+
private class MessageListener : Dino.MessageListener {
public string[] after_actions_const = new string[]{ "DEDUPLICATE", "FILTER_EMPTY" };
diff --git a/libdino/src/service/file_manager.vala b/libdino/src/service/file_manager.vala
index 5b89d1c2..e0a417ee 100644
--- a/libdino/src/service/file_manager.vala
+++ b/libdino/src/service/file_manager.vala
@@ -86,7 +86,7 @@ public class FileManager : StreamInteractionModule, Object {
FileSendData file_send_data = null;
foreach (FileSender file_sender in file_senders) {
if (file_sender.can_send(conversation, file_transfer)) {
- file_send_data = yield file_sender.prepare_send_file(conversation, file_transfer);
+ file_send_data = yield file_sender.prepare_send_file(conversation, file_transfer, file_meta);
break;
}
}
@@ -391,7 +391,7 @@ public interface FileSender : Object {
public abstract bool is_upload_available(Conversation conversation);
public abstract bool can_send(Conversation conversation, FileTransfer file_transfer);
- public abstract async FileSendData? prepare_send_file(Conversation conversation, FileTransfer file_transfer) throws FileSendError;
+ public abstract async FileSendData? prepare_send_file(Conversation conversation, FileTransfer file_transfer, FileMeta file_meta) throws FileSendError;
public abstract async void send_file(Conversation conversation, FileTransfer file_transfer, FileSendData file_send_data) throws FileSendError;
public abstract int get_id();
diff --git a/libdino/src/service/jingle_file_transfers.vala b/libdino/src/service/jingle_file_transfers.vala
index 94fbce09..0a93979b 100644
--- a/libdino/src/service/jingle_file_transfers.vala
+++ b/libdino/src/service/jingle_file_transfers.vala
@@ -111,7 +111,7 @@ public class JingleFileSender : FileSender, Object {
return false;
}
- public async FileSendData? prepare_send_file(Conversation conversation, FileTransfer file_transfer) throws FileSendError {
+ public async FileSendData? prepare_send_file(Conversation conversation, FileTransfer file_transfer, FileMeta file_meta) throws FileSendError {
return new FileSendData();
}
diff --git a/libdino/src/service/muc_manager.vala b/libdino/src/service/muc_manager.vala
index 21d11f5d..392339c1 100644
--- a/libdino/src/service/muc_manager.vala
+++ b/libdino/src/service/muc_manager.vala
@@ -15,6 +15,7 @@ public class MucManager : StreamInteractionModule, Object {
public signal void room_name_set(Account account, Jid jid, string? room_name);
public signal void private_room_occupant_updated(Account account, Jid room, Jid occupant);
public signal void bookmarks_updated(Account account, Gee.List<Xep.Bookmarks.Conference> conferences);
+ public signal void invite_received(Account account, Jid room_jid, Jid from_jid, string? password, string? reason);
private StreamInteractor stream_interactor;
private HashMap<Jid, Xep.Muc.MucEnterError> enter_errors = new HashMap<Jid, Xep.Muc.MucEnterError>(Jid.hash_func, Jid.equals_func);
@@ -264,6 +265,9 @@ public class MucManager : StreamInteractionModule, Object {
stream_interactor.module_manager.get_module(account, Xep.Muc.Module.IDENTITY).subject_set.connect( (stream, subject, jid) => {
subject_set(account, jid, subject);
});
+ 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).room_name_set.connect( (stream, jid, room_name) => {
room_name_set(account, jid, room_name);
});
diff --git a/libdino/src/service/notification_events.vala b/libdino/src/service/notification_events.vala
index 1beeb4ed..f47b9a0a 100644
--- a/libdino/src/service/notification_events.vala
+++ b/libdino/src/service/notification_events.vala
@@ -12,6 +12,7 @@ public class NotificationEvents : StreamInteractionModule, Object {
public signal void notify_content_item(ContentItem content_item, Conversation conversation);
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);
private StreamInteractor stream_interactor;
@@ -28,6 +29,8 @@ 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.connection_manager.connection_error.connect((account, error) => notify_connection_error(account, error));
stream_interactor.get_module(MessageProcessor.IDENTITY).history_synced.connect((account) => {
synced_accounts.add(account);
if (!mam_potential_new.has_key(account)) return;
@@ -40,7 +43,6 @@ public class NotificationEvents : StreamInteractionModule, Object {
}
mam_potential_new[account].clear();
});
- stream_interactor.connection_manager.connection_error.connect((account, error) => notify_connection_error(account, error));
}
private void on_content_item_received(ContentItem item, Conversation conversation) {