From 3f531d6b91edab6c79fa232143db828bad13853c Mon Sep 17 00:00:00 2001 From: fiaxh Date: Sat, 11 Nov 2017 21:29:13 +0100 Subject: Read+(write) stream async --- main/src/ui/add_conversation/add_conference_dialog.vala | 2 +- .../ui/add_conversation/conference_details_fragment.vala | 7 +------ main/src/ui/add_conversation/conference_list.vala | 14 ++++---------- main/src/ui/add_conversation/roster_list.vala | 4 ++-- 4 files changed, 8 insertions(+), 19 deletions(-) (limited to 'main/src/ui/add_conversation') diff --git a/main/src/ui/add_conversation/add_conference_dialog.vala b/main/src/ui/add_conversation/add_conference_dialog.vala index 5e5698fb..d840ff2a 100644 --- a/main/src/ui/add_conversation/add_conference_dialog.vala +++ b/main/src/ui/add_conversation/add_conference_dialog.vala @@ -36,7 +36,7 @@ public class AddConferenceDialog : Gtk.Dialog { setup_conference_details_view(); show_jid_add_view(); - stream_interactor.get_module(MucManager.IDENTITY).joined.connect((account, jid, nick) => { Idle.add(() => { on_joined(account, jid, nick); return false; } ); }); + stream_interactor.get_module(MucManager.IDENTITY).joined.connect(on_joined); } private void show_jid_add_view() { diff --git a/main/src/ui/add_conversation/conference_details_fragment.vala b/main/src/ui/add_conversation/conference_details_fragment.vala index 064d1053..fbe9245d 100644 --- a/main/src/ui/add_conversation/conference_details_fragment.vala +++ b/main/src/ui/add_conversation/conference_details_fragment.vala @@ -99,12 +99,7 @@ protected class ConferenceDetailsFragment : Box { jid_entry.key_release_event.connect(() => { done = true; return false; }); // just for notifying nick_entry.key_release_event.connect(() => { done = true; return false; }); - stream_interactor.get_module(MucManager.IDENTITY).enter_error.connect((account, jid, error) => { - Idle.add(() => { - on_enter_error(account, jid, error); - return false; - }); - }); + stream_interactor.get_module(MucManager.IDENTITY).enter_error.connect(on_enter_error); notification_button.clicked.connect(() => { notification_revealer.set_reveal_child(false); }); ok_button.clicked.connect(() => { ok_button.label = _("Joining..."); diff --git a/main/src/ui/add_conversation/conference_list.vala b/main/src/ui/add_conversation/conference_list.vala index 570166b1..8338558c 100644 --- a/main/src/ui/add_conversation/conference_list.vala +++ b/main/src/ui/add_conversation/conference_list.vala @@ -21,11 +21,8 @@ protected class ConferenceList : FilterableList { set_sort_func(sort); stream_interactor.get_module(MucManager.IDENTITY).bookmarks_updated.connect((account, conferences) => { - Idle.add(() => { - lists[account] = conferences; - refresh_conferences(); - return false; - }); + lists[account] = conferences; + refresh_conferences(); }); foreach (Account account in stream_interactor.get_accounts()) { @@ -43,11 +40,8 @@ protected class ConferenceList : FilterableList { } private void on_conference_bookmarks_received(Core.XmppStream stream, Account account, Gee.List conferences) { - Idle.add(() => { - lists[account] = conferences; - refresh_conferences(); - return false; - }); + lists[account] = conferences; + refresh_conferences(); } private void header(ListBoxRow row, ListBoxRow? before_row) { diff --git a/main/src/ui/add_conversation/roster_list.vala b/main/src/ui/add_conversation/roster_list.vala index 70e4bc14..3107dc47 100644 --- a/main/src/ui/add_conversation/roster_list.vala +++ b/main/src/ui/add_conversation/roster_list.vala @@ -25,12 +25,12 @@ protected class RosterList : FilterableList { handler_ids += stream_interactor.get_module(RosterManager.IDENTITY).removed_roster_item.connect( (account, jid, roster_item) => { if (accounts.contains(account)) { - Idle.add(() => { on_removed_roster_item(account, jid, roster_item); return false;}); + on_removed_roster_item(account, jid, roster_item); } }); handler_ids += stream_interactor.get_module(RosterManager.IDENTITY).updated_roster_item.connect( (account, jid, roster_item) => { if (accounts.contains(account)) { - Idle.add(() => { on_updated_roster_item(account, jid, roster_item); return false;}); + on_updated_roster_item(account, jid, roster_item); } }); destroy.connect(() => { -- cgit v1.2.3-70-g09d2