aboutsummaryrefslogtreecommitdiff
path: root/xmpp-vala/src/module/roster
diff options
context:
space:
mode:
Diffstat (limited to 'xmpp-vala/src/module/roster')
-rw-r--r--xmpp-vala/src/module/roster/module.vala10
1 files changed, 4 insertions, 6 deletions
diff --git a/xmpp-vala/src/module/roster/module.vala b/xmpp-vala/src/module/roster/module.vala
index e0d8aeb3..4c1028fb 100644
--- a/xmpp-vala/src/module/roster/module.vala
+++ b/xmpp-vala/src/module/roster/module.vala
@@ -38,13 +38,11 @@ public class Module : XmppStreamModule, Iq.Handler {
* @param handle Handle to be set. If null, any handle will be removed.
*/
public void set_jid_handle(XmppStream stream, string jid, string? handle) {
- Item roster_item = new Item();
- roster_item.jid = jid;
- if (handle != null) {
- roster_item.name = handle;
- }
+ Flag flag = stream.get_flag(Flag.IDENTITY);
+ Item item = flag.get_item(jid) ?? new Item() { jid=jid };
+ item.name = handle != null ? handle : "";
- roster_set(stream, roster_item);
+ roster_set(stream, item);
}
public void on_iq_set(XmppStream stream, Iq.Stanza iq) {