Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

message_feed_errors: Don't show search public stream to spectators.

Aman Agrawalb4075b78eb6e
diff --git a/static/js/message_scroll.js b/static/js/message_scroll.js
index 9092d3ff5b5..471dfc7dfb1 100644
--- a/static/js/message_scroll.js
+++ b/static/js/message_scroll.js
@@ -82,6 +82,7 @@ export function show_end_of_results_notice() {
$(".all-messages-search-caution").show();
// Set the link to point to this search with streams:public added.
+ // Note that element we adjust is not visible to spectators.
const operators = narrow_state.filter().operators();
const update_hash = hash_util.search_public_streams_notice_url(operators);
$(".all-messages-search-caution a.search-shared-history").attr("href", update_hash);
diff --git a/static/templates/message_feed_errors.hbs b/static/templates/message_feed_errors.hbs
index 9e7911e5975..cc66cf314f9 100644
--- a/static/templates/message_feed_errors.hbs
+++ b/static/templates/message_feed_errors.hbs
@@ -19,10 +19,18 @@
target="_blank" rel="noopener noreferrer">{{> @partial-block}}</a>{{/inline}}
{{/tr}}
&nbsp;
- {{#tr}}
- Consider <z-link>searching all public streams</z-link>.
- {{#*inline "z-link"}}<a class="search-shared-history" href="">{{> @partial-block}}</a>{{/inline}}
- {{/tr}}
+ <span class="only-visible-for-spectators">
+ {{#tr}}
+ <z-link>Log in</z-link> to search your personal history.
+ {{#*inline "z-link"}}<a href="/login/">{{> @partial-block}}</a>{{/inline}}
+ {{/tr}}
+ </span>
+ <span class="hidden-for-spectators">
+ {{#tr}}
+ Consider <z-link>searching all public streams</z-link>.
+ {{#*inline "z-link"}}<a class="search-shared-history" href="">{{> @partial-block}}</a>{{/inline}}
+ {{/tr}}
+ </span>
</p>
</div>
<div class="empty_feed_notice_main"></div>