Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] Broken search results #16768

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/search/client/provider/result.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<div class="flex-tab__result js-list">
<ul class="list clearfix">
{{# with messageContext}}
{{#each msg in result.message.docs}}{{> message msg=(messageParse msg) room=room subscription=subscription settings=settings u=u}}{{/each}}
{{#each msg in result.message.docs}}{{> message msg=(messageParse msg) room=room subscription=subscription settings=settings u=u isSearchResult=true}}{{/each}}
{{/with}}
</ul>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/ui-message/client/message.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template name="message">
<li id="{{templatePrefix}}{{msg._id}}" data-id="{{msg._id}}" data-context={{actionContext}} class="message {{ignoredClass}} {{system}} {{t}} {{own}} {{isTemp}} {{chatops}} {{collapsed}} {{customClass}}" data-username="{{msg.u.username}}" data-tmid="{{msg.tmid}}" data-groupable="{{isGroupable}}" data-date="{{date}}" data-timestamp="{{timestamp}}" data-alias="{{msg.alias}}">
{{#if isThreadReply}}
{{#if renderAsThreadReply}}
{{> messageThread parentMessage=parentMessage threadMessage=threadMessage following=msg.following avatar=msg.u.username msg=msg body=body class=bodyClass}}
{{else}}
{{#if msg.avatar}}
Expand Down
5 changes: 3 additions & 2 deletions app/ui-message/client/message.js
Original file line number Diff line number Diff line change
Expand Up @@ -407,9 +407,10 @@ Template.message.helpers({
const { msg } = this;
return msg.actionContext === 'snippeted';
},
isThreadReply() {
renderAsThreadReply() {
const { groupable, msg: { tmid, t, groupable: _groupable }, settings: { showreply } } = this;
return !(groupable === true || _groupable === true) && !!(tmid && showreply && (!t || t === 'e2e'));
const isThreadReply = !(groupable === true || _groupable === true) && !!(tmid && showreply && (!t || t === 'e2e'));
return isThreadReply && !this.isSearchResult;
},
collapsed() {
const { msg: { tmid, collapsed }, settings: { showreply }, shouldCollapseReplies } = this;
Expand Down