aboutsummaryrefslogtreecommitdiff
path: root/main/src/view_model/account_details.vala
diff options
context:
space:
mode:
Diffstat (limited to 'main/src/view_model/account_details.vala')
-rw-r--r--main/src/view_model/account_details.vala21
1 files changed, 21 insertions, 0 deletions
diff --git a/main/src/view_model/account_details.vala b/main/src/view_model/account_details.vala
new file mode 100644
index 00000000..a9ddeca5
--- /dev/null
+++ b/main/src/view_model/account_details.vala
@@ -0,0 +1,21 @@
+using Dino;
+using Dino.Entities;
+using Xmpp;
+using Xmpp.Xep;
+
+public class Dino.Ui.ViewModel.AccountDetails : Object {
+ public Entities.Account account { get; set; }
+ public string bare_jid { owned get { return account.bare_jid.to_string(); } }
+ public CompatAvatarPictureModel avatar_model { get; set; }
+ public ConnectionManager.ConnectionState connection_state { get; set; }
+ public ConnectionManager.ConnectionError? connection_error { get; set; }
+
+ public AccountDetails(Account account, StreamInteractor stream_interactor) {
+ var account_conv = new Conversation(account.bare_jid, account, Conversation.Type.CHAT);
+
+ this.account = account;
+ this.avatar_model = new ViewModel.CompatAvatarPictureModel(stream_interactor).set_conversation(account_conv);
+ this.connection_state = stream_interactor.connection_manager.get_state(account);
+ this.connection_error = stream_interactor.connection_manager.get_error(account);
+ }
+} \ No newline at end of file