Rocket.Chat icon indicating copy to clipboard operation
Rocket.Chat copied to clipboard

[IMPROVE] Quotes on E2EE Messages

Open yash-rajpal opened this issue 3 years ago • 1 comments

Proposed changes (including videos or screenshots)

This PR provides basic quoting to E2EE messages, it doesn't support multiple chaining of quotes messages.

Screenshot 2022-07-19 at 9 42 19 PM

Issue(s)

#19110 #16148

Steps to test or reproduce

Further comments

This implementation has a few limitations on how quoting will work in E2EE messages. Quotes are handled as attachments and generally quotes are added by the server when it receives the message with some message-link in its content. This approach is not possible for E2EE messages as server receives the encrypted message and cannot get the links. So quotes on E2EE messages have to be handled on Client side.

Here we use the API chat.getMessage to get the quoted message so we cannot see quoted messages of rooms of which user is not a part of.

We can also not chain multiple quote messages as server has no information on existing quote attachments on a E2EE message (only client has that info), though we can handle this on client side meteor collections, but not sure if that is a good idea.

yash-rajpal avatar Jul 19 '22 16:07 yash-rajpal

Codecov Report

Merging #26303 (826a33e) into develop (a0077e5) will decrease coverage by 0.19%. The diff coverage is 2.22%.

:exclamation: Current head 826a33e differs from pull request most recent head a5330ff. Consider uploading reports for the commit a5330ff to get more accurate results

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #26303      +/-   ##
===========================================
- Coverage    41.21%   41.01%   -0.20%     
===========================================
  Files          803      805       +2     
  Lines        17824    17857      +33     
  Branches      1971     1997      +26     
===========================================
- Hits          7346     7324      -22     
- Misses       10183    10237      +54     
- Partials       295      296       +1     
Flag Coverage Δ
e2e 41.01% <2.22%> (-0.20%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

codecov[bot] avatar Aug 10 '22 09:08 codecov[bot]

This pull request introduces 2 alerts when merging e02ccc3a4e6a0870b007cc73f29f6ceb186fd6e1 into 5240f1624eba4da75506a21a9fdc284e2a843c6e - view on LGTM.com

new alerts:

  • 2 for Unused variable, import, function or class

lgtm-com[bot] avatar Sep 06 '22 16:09 lgtm-com[bot]

@yash-rajpal You linked this issue for this PR https://github.com/RocketChat/Rocket.Chat/issues/24721 , but it also requires working attachment previews in E2E to be closed. Is that included, or did you only modify quoting?

KamilSucharski avatar Nov 30 '22 20:11 KamilSucharski