aboutsummaryrefslogtreecommitdiff
path: root/libdino
diff options
context:
space:
mode:
Diffstat (limited to 'libdino')
-rw-r--r--libdino/src/entity/conversation.vala4
-rw-r--r--libdino/src/service/database.vala6
-rw-r--r--libdino/src/service/muc_manager.vala5
-rw-r--r--libdino/src/service/roster_manager.vala11
4 files changed, 18 insertions, 8 deletions
diff --git a/libdino/src/entity/conversation.vala b/libdino/src/entity/conversation.vala
index d4f2f7a7..40bff1c2 100644
--- a/libdino/src/entity/conversation.vala
+++ b/libdino/src/entity/conversation.vala
@@ -26,7 +26,7 @@ public class Conversation : Object {
}
public Encryption encryption { get; set; default = Encryption.NONE; }
public Type type_ { get; set; }
- public Message read_up_to { get; set; }
+ public Message? read_up_to { get; set; }
public enum NotifySetting { DEFAULT, ON, OFF, HIGHLIGHT }
public NotifySetting notify_setting { get; set; default = NotifySetting.DEFAULT; }
@@ -157,4 +157,4 @@ public class Conversation : Object {
}
}
-} \ No newline at end of file
+}
diff --git a/libdino/src/service/database.vala b/libdino/src/service/database.vala
index ae8d5412..333c599b 100644
--- a/libdino/src/service/database.vala
+++ b/libdino/src/service/database.vala
@@ -122,12 +122,12 @@ public class Database : Qlite.Database {
public class RosterTable : Table {
public Column<int> account_id = new Column.Integer("account_id");
public Column<string> jid = new Column.Text("jid");
- public Column<string> name = new Column.Text("name");
+ public Column<string> handle = new Column.Text("name");
public Column<string> subscription = new Column.Text("subscription");
internal RosterTable(Database db) {
base(db, "roster");
- init({account_id, jid, name, subscription});
+ init({account_id, jid, handle, subscription});
unique({account_id, jid}, "IGNORE");
}
}
@@ -333,4 +333,4 @@ public class Database : Qlite.Database {
}
}
-} \ No newline at end of file
+}
diff --git a/libdino/src/service/muc_manager.vala b/libdino/src/service/muc_manager.vala
index c6f37116..7761373f 100644
--- a/libdino/src/service/muc_manager.vala
+++ b/libdino/src/service/muc_manager.vala
@@ -134,6 +134,11 @@ public class MucManager : StreamInteractionModule, Object {
}
}
+ public string? get_room_name(Account account, Jid jid) {
+ Core.XmppStream? stream = stream_interactor.get_stream(account);
+ return stream != null ? stream.get_flag(Xep.Muc.Flag.IDENTITY).get_room_name(jid.to_string()) : null;
+ }
+
public string? get_groupchat_subject(Jid jid, Account account) {
Core.XmppStream? stream = stream_interactor.get_stream(account);
if (stream != null) {
diff --git a/libdino/src/service/roster_manager.vala b/libdino/src/service/roster_manager.vala
index e17c24e3..51a64625 100644
--- a/libdino/src/service/roster_manager.vala
+++ b/libdino/src/service/roster_manager.vala
@@ -49,6 +49,11 @@ public class RosterManager : StreamInteractionModule, Object {
if (stream != null) stream.get_module(Xmpp.Roster.Module.IDENTITY).add_jid(stream, jid.bare_jid.to_string(), handle);
}
+ public void set_jid_handle(Account account, Jid jid, string? handle) {
+ Core.XmppStream? stream = stream_interactor.get_stream(account);
+ if (stream != null) stream.get_module(Xmpp.Roster.Module.IDENTITY).set_jid_handle(stream, jid.bare_jid.to_string(), handle);
+ }
+
private void on_account_added(Account account) {
stream_interactor.module_manager.get_module(account, Roster.Module.IDENTITY).received_roster.connect( (stream, roster) => {
foreach (Roster.Item roster_item in roster) {
@@ -81,7 +86,7 @@ public class RosterStoreImpl : Roster.Storage, Object {
foreach (Qlite.Row row in db.roster.select().with(db.roster.account_id, "=", account.id)) {
Roster.Item item = new Roster.Item();
item.jid = row[db.roster.jid];
- item.name = row[db.roster.name];
+ item.name = row[db.roster.handle];
item.subscription = row[db.roster.subscription];
items[item.jid] = item;
}
@@ -115,7 +120,7 @@ public class RosterStoreImpl : Roster.Storage, Object {
db.roster.insert().or("REPLACE")
.value(db.roster.account_id, account.id)
.value(db.roster.jid, item.jid)
- .value(db.roster.name, item.name)
+ .value(db.roster.handle, item.name)
.value(db.roster.subscription, item.subscription)
.perform();
}
@@ -128,4 +133,4 @@ public class RosterStoreImpl : Roster.Storage, Object {
}
}
-} \ No newline at end of file
+}