aboutsummaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
Diffstat (limited to 'main')
-rw-r--r--main/src/ui/add_conversation/add_conference_dialog.vala3
-rw-r--r--main/src/ui/add_conversation/add_contact_dialog.vala1
-rw-r--r--main/src/ui/add_conversation/add_groupchat_dialog.vala5
-rw-r--r--main/src/ui/add_conversation/conference_details_fragment.vala1
-rw-r--r--main/src/ui/add_conversation/conference_list.vala16
-rw-r--r--main/src/ui/add_conversation/list_row.vala1
-rw-r--r--main/src/ui/add_conversation/roster_list.vala4
-rw-r--r--main/src/ui/add_conversation/select_contact_dialog.vala1
-rw-r--r--main/src/ui/add_conversation/select_jid_fragment.vala1
-rw-r--r--main/src/ui/application.vala1
-rw-r--r--main/src/ui/avatar_generator.vala3
-rw-r--r--main/src/ui/chat_input/encryption_button.vala14
-rw-r--r--main/src/ui/chat_input/occupants_tab_completer.vala1
-rw-r--r--main/src/ui/chat_input/view.vala4
-rw-r--r--main/src/ui/contact_details/muc_config_form_provider.vala2
-rw-r--r--main/src/ui/conversation_selector/chat_row.vala4
-rw-r--r--main/src/ui/conversation_selector/conversation_row.vala1
-rw-r--r--main/src/ui/conversation_selector/groupchat_pm_row.vala1
-rw-r--r--main/src/ui/conversation_selector/groupchat_row.vala2
-rw-r--r--main/src/ui/conversation_selector/list.vala14
-rw-r--r--main/src/ui/conversation_summary/default_file_display.vala3
-rw-r--r--main/src/ui/conversation_summary/default_message_display.vala1
-rw-r--r--main/src/ui/conversation_summary/image_display.vala3
-rw-r--r--main/src/ui/conversation_summary/slashme_message_display.vala1
-rw-r--r--main/src/ui/manage_accounts/add_account_dialog.vala1
-rw-r--r--main/src/ui/manage_accounts/dialog.vala1
-rw-r--r--main/src/ui/occupant_menu/list.vala5
-rw-r--r--main/src/ui/occupant_menu/view.vala1
-rw-r--r--main/src/ui/util/helper.vala21
29 files changed, 72 insertions, 45 deletions
diff --git a/main/src/ui/add_conversation/add_conference_dialog.vala b/main/src/ui/add_conversation/add_conference_dialog.vala
index d840ff2a..f6597505 100644
--- a/main/src/ui/add_conversation/add_conference_dialog.vala
+++ b/main/src/ui/add_conversation/add_conference_dialog.vala
@@ -2,6 +2,7 @@ using Gee;
using Gtk;
using Dino.Entities;
+using Xmpp;
namespace Dino.Ui {
@@ -122,7 +123,7 @@ public class AddConferenceDialog : Gtk.Dialog {
ConferenceListRow? conference_row = conference_list.get_selected_row() as ConferenceListRow;
if (conference_row != null) {
details_fragment.account = conference_row.account;
- details_fragment.jid = conference_row.bookmark.jid;
+ details_fragment.jid = conference_row.bookmark.jid.to_string();
details_fragment.nick = conference_row.bookmark.nick;
if (conference_row.bookmark.password != null) details_fragment.password = conference_row.bookmark.password;
ok_button.grab_focus();
diff --git a/main/src/ui/add_conversation/add_contact_dialog.vala b/main/src/ui/add_conversation/add_contact_dialog.vala
index decc588d..33f6fa72 100644
--- a/main/src/ui/add_conversation/add_contact_dialog.vala
+++ b/main/src/ui/add_conversation/add_contact_dialog.vala
@@ -2,6 +2,7 @@ using Gee;
using Gtk;
using Dino.Entities;
+using Xmpp;
namespace Dino.Ui {
diff --git a/main/src/ui/add_conversation/add_groupchat_dialog.vala b/main/src/ui/add_conversation/add_groupchat_dialog.vala
index 2ecc9e19..53359813 100644
--- a/main/src/ui/add_conversation/add_groupchat_dialog.vala
+++ b/main/src/ui/add_conversation/add_groupchat_dialog.vala
@@ -2,6 +2,7 @@ using Gee;
using Gtk;
using Dino.Entities;
+using Xmpp;
namespace Dino.Ui {
@@ -43,7 +44,7 @@ protected class AddGroupchatDialog : Gtk.Dialog {
accounts_stack.set_visible_child_name("label");
account_label.label = account.bare_jid.to_string();
account_combobox.selected = account;
- jid_entry.text = conference.jid;
+ jid_entry.text = conference.jid.to_string();
nick_entry.text = conference.nick ?? "";
alias_entry.text = conference.name;
}
@@ -64,7 +65,7 @@ protected class AddGroupchatDialog : Gtk.Dialog {
}
private void on_ok_button_clicked() {
- Xmpp.Xep.Bookmarks.Conference conference = new Xmpp.Xep.Bookmarks.Conference(jid_entry.text);
+ Xmpp.Xep.Bookmarks.Conference conference = new Xmpp.Xep.Bookmarks.Conference(Jid.parse(jid_entry.text));
conference.nick = nick_entry.text != "" ? nick_entry.text : null;
conference.name = alias_entry.text;
if (edit_conference == null) {
diff --git a/main/src/ui/add_conversation/conference_details_fragment.vala b/main/src/ui/add_conversation/conference_details_fragment.vala
index 5efcb593..964bb059 100644
--- a/main/src/ui/add_conversation/conference_details_fragment.vala
+++ b/main/src/ui/add_conversation/conference_details_fragment.vala
@@ -2,6 +2,7 @@ using Gdk;
using Gtk;
using Dino.Entities;
+using Xmpp;
namespace Dino.Ui {
diff --git a/main/src/ui/add_conversation/conference_list.vala b/main/src/ui/add_conversation/conference_list.vala
index 8338558c..dfe80a66 100644
--- a/main/src/ui/add_conversation/conference_list.vala
+++ b/main/src/ui/add_conversation/conference_list.vala
@@ -39,8 +39,12 @@ protected class ConferenceList : FilterableList {
}
}
- private void on_conference_bookmarks_received(Core.XmppStream stream, Account account, Gee.List<Xep.Bookmarks.Conference> conferences) {
- lists[account] = conferences;
+ private void on_conference_bookmarks_received(XmppStream stream, Account account, Gee.List<Xep.Bookmarks.Conference>? conferences) {
+ if (conferences == null) {
+ lists.unset(account);
+ } else {
+ lists[account] = conferences;
+ }
refresh_conferences();
}
@@ -77,15 +81,15 @@ internal class ConferenceListRow : ListRow {
public Xep.Bookmarks.Conference bookmark;
public ConferenceListRow(StreamInteractor stream_interactor, Xep.Bookmarks.Conference bookmark, Account account) {
- this.jid = new Jid(bookmark.jid);
+ this.jid = bookmark.jid;
this.account = account;
this.bookmark = bookmark;
- name_label.label = bookmark.name ?? bookmark.jid;
+ name_label.label = 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) {
- via_label.label = bookmark.jid;
+ } else if (bookmark.name != null && bookmark.name != bookmark.jid.to_string()) {
+ via_label.label = bookmark.jid.to_string();
} else {
via_label.visible = false;
}
diff --git a/main/src/ui/add_conversation/list_row.vala b/main/src/ui/add_conversation/list_row.vala
index 958445b7..ffc1802b 100644
--- a/main/src/ui/add_conversation/list_row.vala
+++ b/main/src/ui/add_conversation/list_row.vala
@@ -2,6 +2,7 @@ using Gee;
using Gtk;
using Dino.Entities;
+using Xmpp;
namespace Dino.Ui {
diff --git a/main/src/ui/add_conversation/roster_list.vala b/main/src/ui/add_conversation/roster_list.vala
index 3107dc47..fd4d4ade 100644
--- a/main/src/ui/add_conversation/roster_list.vala
+++ b/main/src/ui/add_conversation/roster_list.vala
@@ -49,7 +49,7 @@ protected class RosterList : FilterableList {
private void on_updated_roster_item(Account account, Jid jid, Roster.Item roster_item) {
on_removed_roster_item(account, jid, roster_item);
- ListRow row = new ListRow.from_jid(stream_interactor, new Jid(roster_item.jid), account, accounts.size > 1);
+ ListRow row = new ListRow.from_jid(stream_interactor, roster_item.jid, account, accounts.size > 1);
rows[account][jid] = row;
add(row);
invalidate_sort();
@@ -59,7 +59,7 @@ protected class RosterList : FilterableList {
private void fetch_roster_items(Account account) {
rows[account] = new HashMap<Jid, ListRow>(Jid.hash_func, Jid.equals_func);
foreach (Roster.Item roster_item in stream_interactor.get_module(RosterManager.IDENTITY).get_roster(account)) {
- on_updated_roster_item(account, new Jid(roster_item.jid), roster_item);
+ on_updated_roster_item(account, roster_item.jid, roster_item);
}
}
diff --git a/main/src/ui/add_conversation/select_contact_dialog.vala b/main/src/ui/add_conversation/select_contact_dialog.vala
index b05762ec..80b7f09b 100644
--- a/main/src/ui/add_conversation/select_contact_dialog.vala
+++ b/main/src/ui/add_conversation/select_contact_dialog.vala
@@ -3,6 +3,7 @@ using Gdk;
using Gtk;
using Dino.Entities;
+using Xmpp;
namespace Dino.Ui {
diff --git a/main/src/ui/add_conversation/select_jid_fragment.vala b/main/src/ui/add_conversation/select_jid_fragment.vala
index e6f45ba1..aca0a937 100644
--- a/main/src/ui/add_conversation/select_jid_fragment.vala
+++ b/main/src/ui/add_conversation/select_jid_fragment.vala
@@ -2,6 +2,7 @@ using Gee;
using Gtk;
using Dino.Entities;
+using Xmpp;
namespace Dino.Ui {
diff --git a/main/src/ui/application.vala b/main/src/ui/application.vala
index 3ebe3cff..81cb184a 100644
--- a/main/src/ui/application.vala
+++ b/main/src/ui/application.vala
@@ -2,6 +2,7 @@ using Gtk;
using Dino.Entities;
using Dino.Ui;
+using Xmpp;
public class Dino.Ui.Application : Gtk.Application, Dino.Application {
private Notifications notifications;
diff --git a/main/src/ui/avatar_generator.vala b/main/src/ui/avatar_generator.vala
index dce8e3d6..b89fed21 100644
--- a/main/src/ui/avatar_generator.vala
+++ b/main/src/ui/avatar_generator.vala
@@ -4,6 +4,7 @@ using Gdk;
using Gtk;
using Dino.Entities;
+using Xmpp;
namespace Dino.Ui {
@@ -109,7 +110,7 @@ public class AvatarGenerator {
}
private Pixbuf draw_groupchat_tile(Jid jid, Account account, int width, int height) {
- ArrayList<Jid>? occupants = stream_interactor.get_module(MucManager.IDENTITY).get_other_occupants(jid, account);
+ Gee.List<Jid>? occupants = stream_interactor.get_module(MucManager.IDENTITY).get_other_occupants(jid, account);
if (stateless || occupants == null || occupants.size == 0) {
return draw_chat_tile(jid, account, width, height);
}
diff --git a/main/src/ui/chat_input/encryption_button.vala b/main/src/ui/chat_input/encryption_button.vala
index 5fdcdaf7..439c8ebd 100644
--- a/main/src/ui/chat_input/encryption_button.vala
+++ b/main/src/ui/chat_input/encryption_button.vala
@@ -10,6 +10,7 @@ public class EncryptionButton : MenuButton {
private Conversation? conversation;
private RadioButton? button_unencrypted;
private Map<RadioButton, Plugins.EncryptionListEntry> encryption_radios = new HashMap<RadioButton, Plugins.EncryptionListEntry>();
+ private string? current_icon;
public EncryptionButton() {
relief = ReliefStyle.NONE;
@@ -56,14 +57,17 @@ public class EncryptionButton : MenuButton {
}
}
- private void update_encryption_menu_icon() {
- if (conversation.encryption == Encryption.NONE) {
- set_image(new Image.from_icon_name("changes-allow-symbolic", IconSize.BUTTON));
- } else {
- set_image(new Image.from_icon_name("changes-prevent-symbolic", IconSize.BUTTON));
+ private void set_icon(string icon) {
+ if (icon != current_icon) {
+ image = new Image.from_icon_name(icon, IconSize.BUTTON);
+ current_icon = icon;
}
}
+ private void update_encryption_menu_icon() {
+ set_icon(conversation.encryption == Encryption.NONE ? "changes-allow-symbolic" : "changes-prevent-symbolic");
+ }
+
public new void set_conversation(Conversation conversation) {
this.conversation = conversation;
update_encryption_menu_state();
diff --git a/main/src/ui/chat_input/occupants_tab_completer.vala b/main/src/ui/chat_input/occupants_tab_completer.vala
index 2f35bf0d..b9f5cd45 100644
--- a/main/src/ui/chat_input/occupants_tab_completer.vala
+++ b/main/src/ui/chat_input/occupants_tab_completer.vala
@@ -3,6 +3,7 @@ using Gee;
using Gtk;
using Dino.Entities;
+using Xmpp;
namespace Dino.Ui.ChatInput {
diff --git a/main/src/ui/chat_input/view.vala b/main/src/ui/chat_input/view.vala
index 007e5379..ec551647 100644
--- a/main/src/ui/chat_input/view.vala
+++ b/main/src/ui/chat_input/view.vala
@@ -84,8 +84,8 @@ public class View : Box {
stream_interactor.get_module(MucManager.IDENTITY).change_nick(conversation.account, conversation.counterpart, token[1]);
return;
case "/ping":
- Xmpp.Core.XmppStream? stream = stream_interactor.get_stream(conversation.account);
- stream.get_module(Xmpp.Xep.Ping.Module.IDENTITY).send_ping(stream, conversation.counterpart.to_string() + "/" + token[1], null);
+ Xmpp.XmppStream? stream = stream_interactor.get_stream(conversation.account);
+ stream.get_module(Xmpp.Xep.Ping.Module.IDENTITY).send_ping(stream, conversation.counterpart.with_resource(token[1]), null);
return;
case "/topic":
stream_interactor.get_module(MucManager.IDENTITY).change_subject(conversation.account, conversation.counterpart, token[1]);
diff --git a/main/src/ui/contact_details/muc_config_form_provider.vala b/main/src/ui/contact_details/muc_config_form_provider.vala
index 8340740a..072627bf 100644
--- a/main/src/ui/contact_details/muc_config_form_provider.vala
+++ b/main/src/ui/contact_details/muc_config_form_provider.vala
@@ -17,7 +17,7 @@ public class MucConfigFormProvider : Plugins.ContactDetailsProvider, Object {
public void populate(Conversation conversation, Plugins.ContactDetails contact_details, Plugins.WidgetType type) {
if (type != Plugins.WidgetType.GTK) return;
if (conversation.type_ == Conversation.Type.GROUPCHAT) {
- Xmpp.Core.XmppStream? stream = stream_interactor.get_stream(conversation.account);
+ Xmpp.XmppStream? stream = stream_interactor.get_stream(conversation.account);
if (stream == null) return;
stream_interactor.get_module(MucManager.IDENTITY).get_config_form(conversation.account, conversation.counterpart, (jid, data_form) => {
contact_details.save.connect(() => { data_form.submit(); });
diff --git a/main/src/ui/conversation_selector/chat_row.vala b/main/src/ui/conversation_selector/chat_row.vala
index 692ad1a5..fb427413 100644
--- a/main/src/ui/conversation_selector/chat_row.vala
+++ b/main/src/ui/conversation_selector/chat_row.vala
@@ -3,6 +3,7 @@ using Gee;
using Gtk;
using Dino.Entities;
+using Xmpp;
namespace Dino.Ui.ConversationSelector {
@@ -18,7 +19,6 @@ public class ChatRow : ConversationRow {
stream_interactor.get_module(RosterManager.IDENTITY).updated_roster_item.connect((account, jid, roster_item) => {
if (conversation.account.equals(account) && conversation.counterpart.equals(jid)) {
update_name_label();
- update_avatar();
}
});
}
@@ -41,7 +41,7 @@ public class ChatRow : ConversationRow {
jid_label.label = conversation.counterpart.to_string();
- ArrayList<Jid>? full_jids = stream_interactor.get_module(PresenceManager.IDENTITY).get_full_jids(conversation.counterpart, conversation.account);
+ Gee.List<Jid>? full_jids = stream_interactor.get_module(PresenceManager.IDENTITY).get_full_jids(conversation.counterpart, conversation.account);
if (full_jids != null) {
for (int i = 0; i < full_jids.size; i++) {
inner_box.add(get_fulljid_box(full_jids[i]));
diff --git a/main/src/ui/conversation_selector/conversation_row.vala b/main/src/ui/conversation_selector/conversation_row.vala
index 45e7277a..450ae570 100644
--- a/main/src/ui/conversation_selector/conversation_row.vala
+++ b/main/src/ui/conversation_selector/conversation_row.vala
@@ -4,6 +4,7 @@ using Gtk;
using Pango;
using Dino.Entities;
+using Xmpp;
namespace Dino.Ui.ConversationSelector {
diff --git a/main/src/ui/conversation_selector/groupchat_pm_row.vala b/main/src/ui/conversation_selector/groupchat_pm_row.vala
index 00898f0c..795bdcb6 100644
--- a/main/src/ui/conversation_selector/groupchat_pm_row.vala
+++ b/main/src/ui/conversation_selector/groupchat_pm_row.vala
@@ -15,7 +15,6 @@ public class GroupchatPmRow : ConversationRow {
tooltip.set_custom(generate_tooltip());
return true;
});
- update_avatar();
}
protected override void update_message_label() {
diff --git a/main/src/ui/conversation_selector/groupchat_row.vala b/main/src/ui/conversation_selector/groupchat_row.vala
index 0dfdfe66..fdbfa40b 100644
--- a/main/src/ui/conversation_selector/groupchat_row.vala
+++ b/main/src/ui/conversation_selector/groupchat_row.vala
@@ -8,12 +8,10 @@ public class GroupchatRow : ConversationRow {
base(stream_interactor, conversation);
has_tooltip = true;
set_tooltip_text(conversation.counterpart.bare_jid.to_string());
- update_avatar();
closed.connect(() => {
stream_interactor.get_module(MucManager.IDENTITY).part(conversation.account, conversation.counterpart);
});
- stream_interactor.get_module(MucManager.IDENTITY).left.connect(update_avatar);
}
protected override void update_message_label() {
diff --git a/main/src/ui/conversation_selector/list.vala b/main/src/ui/conversation_selector/list.vala
index 08958cb5..e250c4cd 100644
--- a/main/src/ui/conversation_selector/list.vala
+++ b/main/src/ui/conversation_selector/list.vala
@@ -26,18 +26,6 @@ public class List : ListBox {
stream_interactor.get_module(ConversationManager.IDENTITY).conversation_deactivated.connect(remove_conversation);
stream_interactor.get_module(MessageProcessor.IDENTITY).message_received.connect(on_message_received);
stream_interactor.get_module(MessageProcessor.IDENTITY).message_sent.connect(on_message_received);
- stream_interactor.get_module(PresenceManager.IDENTITY).show_received.connect((show, jid, account) => {
- foreach (Conversation conversation in stream_interactor.get_module(ConversationManager.IDENTITY).get_conversations_for_presence(show, account)) {
- if (rows.has_key(conversation)) rows[conversation].on_show_received(show);
- }
- });
- stream_interactor.get_module(AvatarManager.IDENTITY).received_avatar.connect((avatar, jid, account) => {
- Conversation? conversation = stream_interactor.get_module(ConversationManager.IDENTITY).get_conversation(jid, account);
- if (conversation != null && rows.has_key(conversation)) {
- ChatRow row = rows[conversation] as ChatRow;
- if (row != null) row.update_avatar();
- }
- });
Timeout.add_seconds(60, () => {
foreach (ConversationRow row in rows.values) row.update();
return true;
@@ -99,7 +87,7 @@ public class List : ListBox {
row.closed.connect(() => { select_next_conversation(conversation); });
row.main_revealer.set_reveal_child(true);
}
- invalidate_sort();
+ //invalidate_sort();
}
private void select_next_conversation(Conversation conversation) {
diff --git a/main/src/ui/conversation_summary/default_file_display.vala b/main/src/ui/conversation_summary/default_file_display.vala
index 42fe2214..15eab6fe 100644
--- a/main/src/ui/conversation_summary/default_file_display.vala
+++ b/main/src/ui/conversation_summary/default_file_display.vala
@@ -2,6 +2,7 @@ using Gdk;
using Gtk;
using Dino.Entities;
+using Xmpp;
namespace Dino.Ui.ConversationSummary {
@@ -26,7 +27,7 @@ public class DefaultFileDisplay : Plugins.MetaConversationItem {
this.stream_interactor = stream_interactor;
this.file_transfer = file_transfer;
- this.jid = file_transfer.direction == FileTransfer.DIRECTION_SENT ? new Jid.with_resource(file_transfer.account.bare_jid.to_string(), file_transfer.account.resourcepart) : file_transfer.counterpart;
+ this.jid = file_transfer.direction == FileTransfer.DIRECTION_SENT ? file_transfer.account.bare_jid.with_resource(file_transfer.account.resourcepart) : file_transfer.counterpart;
this.sort_time = file_transfer.time;
this.seccondary_sort_indicator = file_transfer.id + 0.2903;
this.display_time = file_transfer.time;
diff --git a/main/src/ui/conversation_summary/default_message_display.vala b/main/src/ui/conversation_summary/default_message_display.vala
index f843f116..954012a1 100644
--- a/main/src/ui/conversation_summary/default_message_display.vala
+++ b/main/src/ui/conversation_summary/default_message_display.vala
@@ -1,4 +1,5 @@
using Dino.Entities;
+using Xmpp;
namespace Dino.Ui.ConversationSummary {
diff --git a/main/src/ui/conversation_summary/image_display.vala b/main/src/ui/conversation_summary/image_display.vala
index 6093f759..7b77759b 100644
--- a/main/src/ui/conversation_summary/image_display.vala
+++ b/main/src/ui/conversation_summary/image_display.vala
@@ -1,6 +1,7 @@
using Gtk;
using Dino.Entities;
+using Xmpp;
namespace Dino.Ui.ConversationSummary {
@@ -25,7 +26,7 @@ public class ImageDisplay : Plugins.MetaConversationItem {
this.stream_interactor = stream_interactor;
this.file_transfer = file_transfer;
- this.jid = file_transfer.direction == FileTransfer.DIRECTION_SENT ? new Jid.with_resource(file_transfer.account.bare_jid.to_string(), file_transfer.account.resourcepart) : file_transfer.counterpart;
+ this.jid = file_transfer.direction == FileTransfer.DIRECTION_SENT ? file_transfer.account.bare_jid.with_resource(file_transfer.account.resourcepart) : file_transfer.counterpart;
this.sort_time = file_transfer.time;
this.seccondary_sort_indicator = file_transfer.id + 0.2903;
this.display_time = file_transfer.time;
diff --git a/main/src/ui/conversation_summary/slashme_message_display.vala b/main/src/ui/conversation_summary/slashme_message_display.vala
index f57950bb..3c8af78c 100644
--- a/main/src/ui/conversation_summary/slashme_message_display.vala
+++ b/main/src/ui/conversation_summary/slashme_message_display.vala
@@ -1,6 +1,7 @@
using Gtk;
using Dino.Entities;
+using Xmpp;
namespace Dino.Ui.ConversationSummary {
diff --git a/main/src/ui/manage_accounts/add_account_dialog.vala b/main/src/ui/manage_accounts/add_account_dialog.vala
index 3bd9cc4b..b111a6d5 100644
--- a/main/src/ui/manage_accounts/add_account_dialog.vala
+++ b/main/src/ui/manage_accounts/add_account_dialog.vala
@@ -2,6 +2,7 @@ using Gee;
using Gtk;
using Dino.Entities;
+using Xmpp;
namespace Dino.Ui.ManageAccounts {
diff --git a/main/src/ui/manage_accounts/dialog.vala b/main/src/ui/manage_accounts/dialog.vala
index b157a936..6fb0c427 100644
--- a/main/src/ui/manage_accounts/dialog.vala
+++ b/main/src/ui/manage_accounts/dialog.vala
@@ -4,6 +4,7 @@ using Gtk;
using Markup;
using Dino.Entities;
+using Xmpp;
namespace Dino.Ui.ManageAccounts {
diff --git a/main/src/ui/occupant_menu/list.vala b/main/src/ui/occupant_menu/list.vala
index e89cd3d8..f31ada93 100644
--- a/main/src/ui/occupant_menu/list.vala
+++ b/main/src/ui/occupant_menu/list.vala
@@ -2,6 +2,7 @@ using Gee;
using Gtk;
using Dino.Entities;
+using Xmpp;
namespace Dino.Ui.OccupantMenu{
@@ -39,6 +40,7 @@ public class List : Box {
add_occupant(occupant);
}
}
+ list_box.invalidate_filter();
}
private void refilter() {
@@ -57,8 +59,6 @@ public class List : Box {
public void add_occupant(Jid jid) {
rows[jid] = new ListRow(stream_interactor, conversation.account, jid);
list_box.add(rows[jid]);
- list_box.invalidate_filter();
- list_box.invalidate_sort();
}
public void remove_occupant(Jid jid) {
@@ -77,6 +77,7 @@ public class List : Box {
} else if (show.as != Show.OFFLINE && !rows.has_key(jid)) {
add_occupant(jid);
}
+ list_box.invalidate_filter();
}
}
diff --git a/main/src/ui/occupant_menu/view.vala b/main/src/ui/occupant_menu/view.vala
index a76f370a..1115d0ab 100644
--- a/main/src/ui/occupant_menu/view.vala
+++ b/main/src/ui/occupant_menu/view.vala
@@ -2,6 +2,7 @@ using Gee;
using Gtk;
using Dino.Entities;
+using Xmpp;
namespace Dino.Ui.OccupantMenu {
public class View : Popover {
diff --git a/main/src/ui/util/helper.vala b/main/src/ui/util/helper.vala
index a4f800f8..6d9218e4 100644
--- a/main/src/ui/util/helper.vala
+++ b/main/src/ui/util/helper.vala
@@ -65,7 +65,7 @@ public static string get_display_name(StreamInteractor stream_interactor, Jid ji
}
return jid.resourcepart;
} else {
- if (jid.bare_jid.equals(account.bare_jid.bare_jid)) {
+ if (jid.equals_bare(account.bare_jid)) {
if (account.alias == null || account.alias == "") {
return account.bare_jid.to_string();
} else {
@@ -84,9 +84,24 @@ public static string get_message_display_name(StreamInteractor stream_interactor
return get_display_name(stream_interactor, message.from, account);
}
-public static void image_set_from_scaled_pixbuf(Image image, Gdk.Pixbuf pixbuf, int scale = 0) {
+public static void image_set_from_scaled_pixbuf(Image image, Gdk.Pixbuf pixbuf, int scale = 0, int width = 0, int height = 0) {
if (scale == 0) scale = image.scale_factor;
- image.set_from_surface(Gdk.cairo_surface_create_from_pixbuf(pixbuf, scale, image.get_window()));
+ Cairo.Surface surface = Gdk.cairo_surface_create_from_pixbuf(pixbuf, scale, image.get_window());
+ if (height == 0 && width != 0) {
+ height = (int) ((double) width / pixbuf.width * pixbuf.height);
+ } else if (height != 0 && width == 0) {
+ width = (int) ((double) height / pixbuf.height * pixbuf.width);
+ }
+ if (width != 0) {
+ Cairo.Surface surface_new = new Cairo.Surface.similar_image(surface, Cairo.Format.ARGB32, width, height);
+ Cairo.Context context = new Cairo.Context(surface_new);
+ context.scale((double) width * scale / pixbuf.width, (double) height * scale / pixbuf.height);
+ context.set_source_surface(surface, 0, 0);
+ context.get_source().set_filter(Cairo.Filter.BEST);
+ context.paint();
+ surface = surface_new;
+ }
+ image.set_from_surface(surface);
}
private const string force_background_css = "%s { background-color: %s; }";