parent
c0be0f5f85
commit
f31e96d6bb
|
@ -84,8 +84,8 @@ namespace Dino {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If it's us (jid=our real full JID), display our nick
|
// If it's us (jid=our real full JID), display our nick
|
||||||
if (conversation.type_ == Conversation.Type.GROUPCHAT_PM && conversation.account.bare_jid.equals_bare(jid)) {
|
if (conversation.type_ == Conversation.Type.GROUPCHAT_PM && conversation.account.bare_jid.equals_bare(jid)) {
|
||||||
var muc_conv = stream_interactor.get_module(ConversationManager.IDENTITY).get_conversation(conversation.counterpart.bare_jid, conversation.account, Conversation.Type.GROUPCHAT);
|
var muc_conv = stream_interactor.get_module(ConversationManager.IDENTITY).get_conversation(conversation.counterpart.bare_jid, conversation.account, Conversation.Type.GROUPCHAT);
|
||||||
if (muc_conv != null && muc_conv.nickname != null) {
|
if (muc_conv != null && muc_conv.nickname != null) {
|
||||||
return muc_conv.nickname;
|
return muc_conv.nickname;
|
||||||
|
|
|
@ -412,6 +412,7 @@ public class ConversationView : Box, Plugins.ConversationItemCollection, Plugins
|
||||||
private bool can_merge(Plugins.MetaConversationItem upper_item /*more recent, displayed below*/, Plugins.MetaConversationItem lower_item /*less recent, displayed above*/) {
|
private bool can_merge(Plugins.MetaConversationItem upper_item /*more recent, displayed below*/, Plugins.MetaConversationItem lower_item /*less recent, displayed above*/) {
|
||||||
return upper_item.display_time != null && lower_item.display_time != null &&
|
return upper_item.display_time != null && lower_item.display_time != null &&
|
||||||
upper_item.display_time.difference(lower_item.display_time) < TimeSpan.MINUTE &&
|
upper_item.display_time.difference(lower_item.display_time) < TimeSpan.MINUTE &&
|
||||||
|
upper_item.jid != null && lower_item.jid != null &&
|
||||||
upper_item.jid.equals(lower_item.jid) &&
|
upper_item.jid.equals(lower_item.jid) &&
|
||||||
upper_item.encryption == lower_item.encryption &&
|
upper_item.encryption == lower_item.encryption &&
|
||||||
(upper_item.mark == Message.Marked.WONTSEND) == (lower_item.mark == Message.Marked.WONTSEND);
|
(upper_item.mark == Message.Marked.WONTSEND) == (lower_item.mark == Message.Marked.WONTSEND);
|
||||||
|
|
|
@ -137,9 +137,12 @@ public class BadMessagesWidget : Box {
|
||||||
this.halign = Align.CENTER;
|
this.halign = Align.CENTER;
|
||||||
this.visible = true;
|
this.visible = true;
|
||||||
|
|
||||||
var sb = new StringBuilder();
|
string who = "";
|
||||||
string who = _("Your contact");
|
if (conversation.type_ == Conversation.Type.CHAT) {
|
||||||
if (conversation.type_ == Conversation.Type.GROUPCHAT) {
|
who = Dino.get_participant_display_name(plugin.app.stream_interactor, conversation, jid);
|
||||||
|
} else if (conversation.type_ == Conversation.Type.GROUPCHAT) {
|
||||||
|
who = jid.to_string();
|
||||||
|
// `jid` is a real JID. In MUCs, try to show nicks instead (given that the JID is currently online)
|
||||||
var occupants = plugin.app.stream_interactor.get_module(MucManager.IDENTITY).get_occupants(conversation.counterpart, conversation.account);
|
var occupants = plugin.app.stream_interactor.get_module(MucManager.IDENTITY).get_occupants(conversation.counterpart, conversation.account);
|
||||||
if (occupants == null) return;
|
if (occupants == null) return;
|
||||||
foreach (Jid occupant in occupants) {
|
foreach (Jid occupant in occupants) {
|
||||||
|
@ -148,13 +151,15 @@ public class BadMessagesWidget : Box {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string warning_text = "";
|
||||||
if (badness_type == BadnessType.UNTRUSTED) {
|
if (badness_type == BadnessType.UNTRUSTED) {
|
||||||
sb.append(_("%s has been using an untrusted device. You won't see messages from devices that you do not trust.").printf(who));
|
warning_text = _("%s has been using an untrusted device. You won't see messages from devices that you do not trust.").printf(who) +
|
||||||
sb.append(" <a href=\"\">%s</a>".printf(_("Manage devices")));
|
" <a href=\"\">%s</a>".printf(_("Manage devices"));
|
||||||
} else {
|
} else {
|
||||||
sb.append(_("%s does not trust this device. That means, you might be missing messages.").printf(who));
|
warning_text += _("%s does not trust this device. That means, you might be missing messages.").printf(who);
|
||||||
}
|
}
|
||||||
Label label = new Label(sb.str) { margin_start=70, margin_end=70, justify=Justification.CENTER, use_markup=true, selectable=true, wrap=true, wrap_mode=Pango.WrapMode.WORD_CHAR, hexpand=true, visible=true };
|
Label label = new Label(warning_text) { margin_start=70, margin_end=70, justify=Justification.CENTER, use_markup=true, selectable=true, wrap=true, wrap_mode=Pango.WrapMode.WORD_CHAR, hexpand=true, visible=true };
|
||||||
label.get_style_context().add_class("dim-label");
|
label.get_style_context().add_class("dim-label");
|
||||||
this.add(label);
|
this.add(label);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue