aboutsummaryrefslogtreecommitdiff
path: root/libdino/src/entity
diff options
context:
space:
mode:
authorMarvin W <git@larma.de>2026-05-30 16:10:36 +0200
committerMarvin W <git@larma.de>2026-06-07 23:13:07 +0200
commit158cff3098e9370696f9250a199c78e4f2d18ce0 (patch)
treebd05a55e5419ef2307c7a7f4d7665f7449c8e8b1 /libdino/src/entity
parentafcf44928748f7ac049f1ba9f5c51c6dedbf4ec2 (diff)
Add JID interning
Diffstat (limited to 'libdino/src/entity')
-rw-r--r--libdino/src/entity/account.vala6
-rw-r--r--libdino/src/entity/message.vala2
2 files changed, 4 insertions, 4 deletions
diff --git a/libdino/src/entity/account.vala b/libdino/src/entity/account.vala
index e7729fa0..a108af22 100644
--- a/libdino/src/entity/account.vala
+++ b/libdino/src/entity/account.vala
@@ -10,7 +10,7 @@ public class Account : Object {
public string domainpart { get { return full_jid.domainpart; } }
public string resourcepart {
get { return full_jid.resourcepart; }
- private set { full_jid.resourcepart = value; }
+ private set { full_jid = full_jid.with_resource(value); }
}
public Jid bare_jid { owned get { return full_jid.bare_jid; } }
public Jid full_jid { get; private set; }
@@ -37,7 +37,7 @@ public class Account : Object {
public Account.from_row(Database db, Qlite.Row row) throws InvalidJidError {
this.db = db;
id = row[db.account.id];
- full_jid = new Jid(row[db.account.bare_jid]).with_resource(row[db.account.resourcepart]);
+ full_jid = Jid.from_string(row[db.account.bare_jid]).with_resource(row[db.account.resourcepart]);
password = row[db.account.password];
alias = row[db.account.alias];
enabled = row[db.account.enabled];
@@ -82,7 +82,7 @@ public class Account : Object {
}
public static bool equals_func(Account acc1, Account acc2) {
- return acc1.bare_jid.to_string() == acc2.bare_jid.to_string();
+ return acc1.bare_jid.equals(acc2.bare_jid);
}
public static uint hash_func(Account acc) {
diff --git a/libdino/src/entity/message.vala b/libdino/src/entity/message.vala
index ace59572..16e7ae3f 100644
--- a/libdino/src/entity/message.vala
+++ b/libdino/src/entity/message.vala
@@ -109,7 +109,7 @@ public class Message : Object {
encryption = (Encryption) row[db.message.encryption];
string? real_jid_str = row[db.real_jid.real_jid];
- if (real_jid_str != null) real_jid = new Jid(real_jid_str);
+ if (real_jid_str != null) real_jid = Jid.from_string(real_jid_str);
occupant_db_id = row[db.message_occupant_id.occupant_id];