Directly start chat from xmpp uri if only one account is active
fixes #160
This commit is contained in:
parent
555187deb9
commit
128a015d45
|
@ -58,6 +58,12 @@ public class Dino.Ui.Application : Gtk.Application, Dino.Application {
|
|||
dialog.present();
|
||||
break;
|
||||
case "message":
|
||||
Gee.List<Account> accounts = stream_interactor.get_accounts();
|
||||
if (accounts.size == 1) {
|
||||
Conversation conversation = stream_interactor.get_module(ConversationManager.IDENTITY).create_conversation(new Jid(jid), accounts[0], Conversation.Type.CHAT);
|
||||
stream_interactor.get_module(ConversationManager.IDENTITY).start_conversation(conversation, true);
|
||||
window.on_conversation_selected(conversation);
|
||||
} else {
|
||||
AddConversation.Chat.Dialog dialog = new AddConversation.Chat.Dialog(stream_interactor, stream_interactor.get_accounts());
|
||||
dialog.set_filter(jid);
|
||||
dialog.set_transient_for(window);
|
||||
|
@ -69,6 +75,7 @@ public class Dino.Ui.Application : Gtk.Application, Dino.Application {
|
|||
window.on_conversation_selected(conversation);
|
||||
});
|
||||
dialog.present();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue