aboutsummaryrefslogtreecommitdiff
path: root/libdino/src/service/roster_manager.vala
diff options
context:
space:
mode:
authorfiaxh <git@mx.ax.lt>2017-06-16 14:29:02 +0200
committerfiaxh <git@mx.ax.lt>2017-06-17 16:13:23 +0200
commit26973c89e391de673b6ac1db024a3098b1191393 (patch)
treeeb17d5006c1e70e7e88b71700455c40081b4af47 /libdino/src/service/roster_manager.vala
parent7bbbb738fdb233f4ad91ffdd7d9247b28849d715 (diff)
downloaddino-26973c89e391de673b6ac1db024a3098b1191393.tar.gz
dino-26973c89e391de673b6ac1db024a3098b1191393.zip
Set jid handle in ContactDetails, use LabelHybrids more, remove edit from StartConversation
Diffstat (limited to 'libdino/src/service/roster_manager.vala')
-rw-r--r--libdino/src/service/roster_manager.vala11
1 files changed, 8 insertions, 3 deletions
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
+}