Fix empty display names, fix update contact roster name

This commit is contained in:
fiaxh 2018-05-09 23:19:22 +02:00
parent e852a0a60b
commit 5425243203
5 changed files with 7 additions and 8 deletions

View file

@ -55,15 +55,15 @@ public class RosterManager : StreamInteractionModule, Object {
}
private void on_account_added(Account account) {
stream_interactor.module_manager.get_module(account, Roster.Module.IDENTITY).received_roster.connect( (stream, roster) => {
stream_interactor.module_manager.get_module(account, Roster.Module.IDENTITY).received_roster.connect_after( (stream, roster) => {
foreach (Roster.Item roster_item in roster) {
on_roster_item_updated(account, roster_item);
}
});
stream_interactor.module_manager.get_module(account, Roster.Module.IDENTITY).item_removed.connect( (stream, roster_item) => {
stream_interactor.module_manager.get_module(account, Roster.Module.IDENTITY).item_removed.connect_after( (stream, roster_item) => {
removed_roster_item(account, roster_item.jid, roster_item);
});
stream_interactor.module_manager.get_module(account, Roster.Module.IDENTITY).item_updated.connect( (stream, roster_item) => {
stream_interactor.module_manager.get_module(account, Roster.Module.IDENTITY).item_updated.connect_after( (stream, roster_item) => {
on_roster_item_updated(account, roster_item);
});
}

View file

@ -13,6 +13,7 @@
<property name="allow_gray">False</property>
<property name="height">30</property>
<property name="width">30</property>
<property name="valign">center</property>
<property name="visible">True</property>
</object>
</child>

View file

@ -18,6 +18,7 @@
<object class="DinoUiAvatarImage" id="image">
<property name="height">40</property>
<property name="width">40</property>
<property name="valign">center</property>
<property name="visible">True</property>
</object>
</child>

View file

@ -85,7 +85,7 @@ internal class ConferenceListRow : ListRow {
this.account = account;
this.bookmark = bookmark;
name_label.label = bookmark.name ?? bookmark.jid.to_string();
name_label.label = bookmark.name != null && bookmark.name != "" ? bookmark.name : bookmark.jid.to_string();
if (stream_interactor.get_accounts().size > 1) {
via_label.label = "via " + account.bare_jid.to_string();
} else if (bookmark.name != null && bookmark.name != bookmark.jid.to_string()) {

View file

@ -60,9 +60,6 @@ public static string get_conversation_display_name(StreamInteractor stream_inter
public static string get_display_name(StreamInteractor stream_interactor, Jid jid, Account account) {
if (stream_interactor.get_module(MucManager.IDENTITY).is_groupchat_occupant(jid, account)) {
if (jid.resourcepart == account.resourcepart) {
return account.alias; // FIXME temporary. remove again.
}
return jid.resourcepart;
} else {
if (jid.equals_bare(account.bare_jid)) {
@ -73,7 +70,7 @@ public static string get_display_name(StreamInteractor stream_interactor, Jid ji
}
}
Roster.Item roster_item = stream_interactor.get_module(RosterManager.IDENTITY).get_roster_item(account, jid);
if (roster_item != null && roster_item.name != null) {
if (roster_item != null && roster_item.name != null && roster_item.name != "") {
return roster_item.name;
}
return jid.bare_jid.to_string();