Add debug outputs to summarize_whitespaces_to_space and don't assert_not_reached
related #1335
This commit is contained in:
parent
860c72bfc9
commit
73c0263f35
|
@ -121,6 +121,8 @@ public class ContentItemStore : StreamInteractionModule, Object {
|
||||||
Message? message = get_message_for_content_item(conversation, content_item);
|
Message? message = get_message_for_content_item(conversation, content_item);
|
||||||
if (message == null) return null;
|
if (message == null) return null;
|
||||||
|
|
||||||
|
if (message.edit_to != null) return message.edit_to;
|
||||||
|
|
||||||
if (conversation.type_ == Conversation.Type.CHAT) {
|
if (conversation.type_ == Conversation.Type.CHAT) {
|
||||||
return message.stanza_id;
|
return message.stanza_id;
|
||||||
} else {
|
} else {
|
||||||
|
@ -131,6 +133,9 @@ public class ContentItemStore : StreamInteractionModule, Object {
|
||||||
public Jid? get_message_sender_for_content_item(Conversation conversation, ContentItem content_item) {
|
public Jid? get_message_sender_for_content_item(Conversation conversation, ContentItem content_item) {
|
||||||
Message? message = get_message_for_content_item(conversation, content_item);
|
Message? message = get_message_for_content_item(conversation, content_item);
|
||||||
if (message == null) return null;
|
if (message == null) return null;
|
||||||
|
|
||||||
|
// No need to look at edit_to, because it's the same sender JID.
|
||||||
|
|
||||||
return message.from;
|
return message.from;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -419,7 +419,8 @@ public string summarize_whitespaces_to_space(string s) {
|
||||||
try {
|
try {
|
||||||
return (/\s+/).replace_literal(s, -1, 0, " ");
|
return (/\s+/).replace_literal(s, -1, 0, " ");
|
||||||
} catch (RegexError e) {
|
} catch (RegexError e) {
|
||||||
assert_not_reached();
|
critical("RegexError when summarizing whitespaces in '%s': %s", s, e.message);
|
||||||
|
return s;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue