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.

drafts: Use generic template to show stream icon.

Aman Agrawalff6d04f88c48
diff --git a/web/src/drafts.js b/web/src/drafts.js
index 635c0d4d1ae..4954b1e75a3 100644
--- a/web/src/drafts.js
+++ b/web/src/drafts.js
@@ -339,6 +339,8 @@ export function format_draft(draft) {
const id = draft.id;
let formatted;
const time = new Date(draft.updatedAt);
+ let invite_only = false;
+ let is_web_public = false;
let time_stamp = timerender.render_now(time).time_str;
if (time_stamp === $t({defaultMessage: "Today"})) {
time_stamp = timerender.stringify_time(time);
@@ -350,10 +352,15 @@ export function format_draft(draft) {
let stream_name = draft.stream.length > 0 ? draft.stream : space_string;
if (draft.stream_id) {
const sub = sub_store.get(draft.stream_id);
- if (sub && sub.name !== stream_name) {
- stream_name = sub.name;
- draft.stream = stream_name;
- draft_model.editDraft(id, draft);
+ if (sub) {
+ invite_only = sub.invite_only;
+ is_web_public = sub.is_web_public;
+
+ if (sub.name !== stream_name) {
+ stream_name = sub.name;
+ draft.stream = stream_name;
+ draft_model.editDraft(id, draft);
+ }
}
}
const draft_topic = draft.topic || compose.empty_topic_placeholder();
@@ -368,6 +375,8 @@ export function format_draft(draft) {
topic: draft_topic,
raw_content: draft.content,
time_stamp,
+ invite_only,
+ is_web_public,
};
} else {
const emails = util.extract_pm_recipients(draft.private_message_recipient);
diff --git a/web/templates/draft.hbs b/web/templates/draft.hbs
index 46c2f6be4a8..ecb0895cef4 100644
--- a/web/templates/draft.hbs
+++ b/web/templates/draft.hbs
@@ -3,8 +3,10 @@
{{#if is_stream}}
<div class="message_header message_header_stream">
<div class="message-header-contents">
- <div class="message_label_clickable stream_label {{dark_background}}"
- style="background: {{stream_color}}; border-left-color: {{stream_color}};">
+ <div class="message_label_clickable stream_label">
+ <span class="stream-privacy filter-icon">
+ {{> stream_privacy}}
+ </span>
{{stream_name}}
</div>