parent
d02f7b6a3a
commit
e52a4eacb2
|
@ -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" };
|
||||
|
|
|
@ -93,7 +93,7 @@ public class ConversationSelector : ListBox {
|
|||
|
||||
private void remove_conversation(Conversation conversation) {
|
||||
select_fallback_conversation(conversation);
|
||||
if (rows.has_key(conversation) && !conversation.active) {
|
||||
if (rows.has_key(conversation)) {
|
||||
remove(rows[conversation]);
|
||||
rows.unset(conversation);
|
||||
}
|
||||
|
|
|
@ -173,7 +173,6 @@ public class Dialog : Gtk.Dialog {
|
|||
private bool change_account_state(bool state) {
|
||||
selected_account.enabled = state;
|
||||
if (state) {
|
||||
if (selected_account.enabled) account_disabled(selected_account);
|
||||
account_enabled(selected_account);
|
||||
} else {
|
||||
account_disabled(selected_account);
|
||||
|
|
Loading…
Reference in a new issue