diff options
| author | Marvin W <git@larma.de> | 2026-07-27 14:24:52 +0200 |
|---|---|---|
| committer | Marvin W <git@larma.de> | 2026-08-02 12:44:10 +0200 |
| commit | baea5162d4a855d2ae1ad630ed65861c8faac0e7 (patch) | |
| tree | 478a3f296080322ee5d77d73f771e2873a04cdf7 /libdino/src/entity | |
| parent | 84a47eee3b5cf4a73ad7d14a292f8b23b944a592 (diff) | |
bind2: Add user agent id and details
Diffstat (limited to 'libdino/src/entity')
| -rw-r--r-- | libdino/src/entity/account.vala | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libdino/src/entity/account.vala b/libdino/src/entity/account.vala index f5c99307..0ee7fe79 100644 --- a/libdino/src/entity/account.vala +++ b/libdino/src/entity/account.vala @@ -22,6 +22,7 @@ public class Account : Object { public string? alias { get; set; } public bool enabled { get; set; default = false; } public string? roster_version { get; set; } + public string? user_agent_id { get; set; } private Database? db; @@ -33,6 +34,7 @@ public class Account : Object { error("Auto-generated resource was invalid (%s)", e.message); } this.password = password; + this.user_agent_id = random_uuid(); } public Account.from_row(Database db, Qlite.Row row) throws InvalidJidError { @@ -43,8 +45,12 @@ public class Account : Object { alias = row[db.account.alias]; enabled = row[db.account.enabled]; roster_version = row[db.account.roster_version]; + user_agent_id = row[db.account.user_agent_id]; notify.connect(on_update); + + // Add user agent id if missing + if (user_agent_id == null) user_agent_id = random_uuid(); } public void persist(Database db) { @@ -105,6 +111,8 @@ public class Account : Object { update.set(db.account.enabled, enabled); break; case "roster-version": update.set(db.account.roster_version, roster_version); break; + case "user-agent-id": + update.set(db.account.user_agent_id, user_agent_id); break; } update.perform(); } |
