zulip/static
Sahil Batra 9d2e8aef6d ui_init: Fix condition in message_hover.
The message_hover function in ui_init.js had an if condition
to return early when is_topic_editable was false. We instead
change it to return early when message.sent_by_me is false
since in that case the edit_content element is not present.
Note that we also show the "View source" icon when message
is locally echoed or not sent successfully.

Till now is_topic_editable is always true when message is sent
by the user itself, and when message is sent by someone else
the edit_content element does not exist in the DOM anyway. So,
basically, it just helps in returing early and not unnecessarily
move forward to set html for a non-existent div. So, we can
ideally replace it with just `sent_by_me` condition and otherwise
we already show the reaction icon.

The comment above that also mentioned that "locally echoed messages
have !is_topic_editable" which is not true since is_topic_editable
does not check whether the message is locally-echoed or not. This
comment was added in e1c4c7b80.

This also fixes the bug where "View source" icon is not shown when
"message.sent_by_me" is true and both editing and moving message
is not allowed which currently happens when allow_message_editing
setting is False.

Also, the "is_topic_editable" condition will be not valid in future
when "is_topic_editable" can be false when "sent_by_me" is true. In
such cases we would not show any icon then, so better to fix this
here.

Some history of this code-
- Intially we returned only when !sent_by_me was false, but added
a condition to return early when realm_allow_community_topic_editing
was false in 91197fa4f1. Though it was not needed since edit_content
element amyways did not existed when `sent_by_me` was false.
- Then the condition was then changed to return early if
is_topic_editable was false in 689c717284.
2022-10-23 20:38:05 -07:00
..
assets assets: Remove license for previously deleted emoji images. 2022-06-10 12:27:48 -07:00
audio/notification_sounds audio: Remove the copy of zulip.ogg outside notification_sounds. 2022-06-10 12:27:48 -07:00
generated
html templates: Add HTML title element to templates that extend base/portico. 2022-09-19 20:17:17 -07:00
images help center: Edit "Create your organization profile" info. 2022-10-03 11:33:30 -07:00
js ui_init: Fix condition in message_hover. 2022-10-23 20:38:05 -07:00
shared icons: Change mute icon from bell to speaker. 2022-09-09 17:32:19 -07:00
styles message_edit: Fix vertical alignment of input area in /me messages. 2022-10-21 12:16:15 -07:00
templates recent-topics: Rename to "Recent conversations" in web-app and docs. 2022-10-21 10:28:19 -07:00
third css: Remove Bootstrap legend CSS. 2022-08-13 17:36:08 -07:00
.gitignore docs: Add missing space in “time zone”. 2022-02-24 14:05:12 -08:00