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

feat: edit/delete/reply for emoji/sticker/audio #13808

Merged
merged 10 commits into from
Oct 18, 2022

Conversation

OmarBasem
Copy link
Contributor

@OmarBasem OmarBasem commented Aug 16, 2022

This PR is a continuation of that PR

Fixes #13246

Summary

Add missing actions (edit/delete/reply) to certain types of messages (emoji/sticker/audio)
To implement the needed functionalities there are 2 pull requests to this repo status-mobile and status-go.

  1. Editing emoji messages: Firstly, I had to allow the emoji content type to be edited from status-go. Secondly, when editing an emoji message, I had to check whether it is still an emoji message or is now a text message, and send the contentType. Also, in status-go I added a "ContentType" field to the "EditMessage" struct and updated the content type when a message is edited. Regarding UI, I had to make sure a white space is added at the end of an emoji message when edited (similar to text messages) to avoid overlapping with the "edited" text and icon.

  2. Deleting emoji messages: added delete option on-long-press.

  3. Audio message reply: In status-go, I added an AudioLocalURL field to the QuotedMessage struct. When an audio message is replied to, the AudioLocalURL field will be assigned to the QuotedMessage. In status-mobile, inside the quoted-message method, I check if the quoted message contains audio and if so, will render the audio message.

  4. Sticker message reply: Initially, I attempted to do it in a similar way to replying to audio, but it didn't work as the sticker url is created using the sticker hash and not the message ID. Currently, the "responseTo" field includes the messageID only. So, what I did is simply get the sticker url from the message itself using the messageID inside the quoted-message method in status-mobile. I added a HasSticker field to the QuotedMessage struct in status-go to know if it is a sticker. Additionally, if the sticker is deleted, a message will be shown to the user stating "This message has been deleted!", which I think can also be implemented for replying to other content types.

  5. Sticker message delete: added delete option on-long-press.

Sticker reply and delete also work in public chats.

Review Notes

This PR depends on that status-go PR for backend functionality: 87db7d953e8fc748baa1fc56a7adffd8fada3055

Platforms

  • Android
  • iOS

status: ready

@status-im-auto
Copy link
Member

status-im-auto commented Aug 16, 2022

Jenkins Builds

Click to see older builds (53)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ b1394fe #1 2022-08-16 13:29:59 ~8 min android 📦apk 📲
✔️ b1394fe #1 2022-08-16 13:31:11 ~9 min android-e2e 📦apk 📲
✔️ b1394fe #1 2022-08-16 13:32:31 ~10 min ios 📦ipa 📲
✖️ 33acefe #2 2022-08-16 14:30:38 ~7 min android-e2e 📦apk 📲
✖️ 33acefe #2 2022-08-16 14:31:04 ~7 min android 📦apk 📲
✖️ 33acefe #2 2022-08-16 14:33:10 ~9 min ios 📦ipa 📲
✔️ f425d6d #3 2022-08-16 14:48:03 ~7 min android 📦apk 📲
✔️ f425d6d #3 2022-08-16 14:48:48 ~8 min android-e2e 📦apk 📲
✔️ f425d6d #3 2022-08-16 14:55:37 ~15 min ios 📦ipa 📲
✔️ a0ef7da #4 2022-08-18 10:28:22 ~15 min android-e2e 📦apk 📲
✔️ a0ef7da #4 2022-08-18 10:29:29 ~16 min android 📦apk 📲
✔️ a0ef7da #4 2022-08-18 10:34:23 ~21 min ios 📦ipa 📲
✔️ 6581d2a #5 2022-08-19 05:29:06 ~7 min android-e2e 📦apk 📲
✔️ 6581d2a #5 2022-08-19 05:29:15 ~7 min android 📦apk 📲
6581d2a #5 2022-08-19 05:32:29 ~10 min ios 📄log
6581d2a #6 2022-08-19 06:07:43 ~11 min ios 📄log
✔️ 40a39e8 #6 2022-08-19 07:20:45 ~7 min android-e2e 📦apk 📲
✔️ 40a39e8 #6 2022-08-19 07:21:20 ~7 min android 📦apk 📲
40a39e8 #7 2022-08-19 07:25:47 ~12 min ios 📄log
✔️ f6dd890 #7 2022-08-19 07:56:45 ~9 min android 📦apk 📲
f6dd890 #8 2022-08-19 08:00:29 ~12 min ios 📄log
✔️ ea2c585 #8 2022-08-20 06:28:30 ~7 min android 📦apk 📲
✔️ ea2c585 #8 2022-08-20 06:28:51 ~8 min android-e2e 📦apk 📲
ea2c585 #9 2022-08-20 06:37:38 ~17 min ios 📄log
ea2c585 #1 2022-09-02 12:10:44 ~20 min android 📄log
✔️ 3a8ac53 #2 2022-09-05 13:19:54 ~2 min tests 📦log
✔️ 3a8ac53 #2 2022-09-05 13:26:20 ~8 min android-e2e 📦apk 📲
✔️ 3a8ac53 #2 2022-09-05 13:26:47 ~9 min android 📦apk 📲
✔️ 3a8ac53 #2 2022-09-05 13:33:15 ~15 min ios 📦ipa 📲
✔️ 88dbb01 #3 2022-09-06 08:25:25 ~3 min tests 📦log
✔️ 88dbb01 #3 2022-09-06 08:31:05 ~9 min android 📦apk 📲
✔️ 88dbb01 #3 2022-09-06 08:32:34 ~11 min android-e2e 📦apk 📲
✔️ 88dbb01 #3 2022-09-06 08:45:25 ~23 min ios 📦ipa 📲
✔️ 9d4c718 #4 2022-09-06 09:15:59 ~2 min tests 📦log
✔️ 9d4c718 #4 2022-09-06 09:21:31 ~8 min android-e2e 📦apk 📲
✔️ 9d4c718 #4 2022-09-06 09:22:09 ~9 min android 📦apk 📲
✔️ 9d4c718 #4 2022-09-06 09:26:52 ~13 min ios 📦ipa 📲
✔️ 7477853 #5 2022-10-10 16:21:44 ~2 min tests 📦log
✔️ 7477853 #5 2022-10-10 16:27:19 ~7 min android-e2e 📦apk 📲
✔️ 7477853 #5 2022-10-10 16:27:24 ~7 min android 📦apk 📲
✔️ 7477853 #5 2022-10-10 16:32:11 ~12 min ios 📦ipa 📲
58d51fd #6 2022-10-17 10:54:15 ~14 sec ios 📄log
58d51fd #6 2022-10-17 10:54:18 ~17 sec android-e2e 📄log
58d51fd #6 2022-10-17 10:54:32 ~31 sec tests 📄log
58d51fd #6 2022-10-17 10:54:32 ~32 sec android 📄log
f016e8e #7 2022-10-17 10:55:23 ~13 sec ios 📄log
f016e8e #7 2022-10-17 10:55:24 ~14 sec android-e2e 📄log
f016e8e #7 2022-10-17 10:55:41 ~31 sec android 📄log
f016e8e #7 2022-10-17 10:55:42 ~27 sec tests 📄log
✔️ c128d71 #8 2022-10-17 11:02:03 ~3 min tests 📦log
✔️ c128d71 #8 2022-10-17 11:08:07 ~9 min android 📦apk 📲
✔️ c128d71 #8 2022-10-17 11:08:37 ~10 min android-e2e 📦apk 📲
✔️ c128d71 #8 2022-10-17 11:13:02 ~14 min ios 📦ipa 📲
Commit #️⃣ Finished (UTC) Duration Platform Result
e36d1ef #9 2022-10-18 05:53:11 ~2 min tests 📄log
✔️ e36d1ef #9 2022-10-18 05:57:39 ~7 min android 📦apk 📲
✔️ e36d1ef #9 2022-10-18 05:58:29 ~8 min android-e2e 📦apk 📲
✔️ e36d1ef #9 2022-10-18 06:03:44 ~13 min ios 📦ipa 📲
✔️ 15cf496 #11 2022-10-18 12:25:35 ~10 min tests 📦log
✔️ 15cf496 #11 2022-10-18 12:28:35 ~13 min android-e2e 📦apk 📲
✔️ 15cf496 #11 2022-10-18 12:28:52 ~13 min android 📦apk 📲
✔️ 15cf496 #11 2022-10-18 12:37:39 ~22 min ios 📦ipa 📲

@OmarBasem
Copy link
Contributor Author

To fix all the unnecessary formatting changes caused by the IDE, I had to open a new PR. Please follow on this PR. @flexsurfer @rasom @J-Son89 @briansztamfater @Parveshdhull

Comment on lines 91 to 92
(letsubs [contact-name [:contacts/contact-name-by-identity from]
replied-message (@(re-frame/subscribe [:chats/chat-messages chat-id]) id)] ;; message replied to
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As was suggested in the previous PR it makes sense to replacedefview with defn and letsubs with let. defview is straightforward, adding a sample for letsubs:

(let [contact-name @(re-frame/subscribe [:contacts/contact-name-by-identity from]])
      replied-message (get @(re-frame/subscribe [:chats/chat-messages chat-id]) id)]
...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aha got it, thanks!

@flexsurfer
Copy link
Member

i believe there was a status-go change in the first PR ?

:id :reply
:label (i18n/label :t/message-reply)}]
(when (and outgoing config/delete-message-enabled?))
[{:on-press #(re-frame/dispatch [:chat.ui/soft-delete-message message])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[{:on-press.. should be inside when form

@OmarBasem
Copy link
Contributor Author

i believe there was a status-go change in the first PR ?

@flexsurfer Yes, as mentioned above, this PR depends on that status-go PR for backend functionality. Commit hash: 87db7d953e8fc748baa1fc56a7adffd8fada3055

@OmarBasem
Copy link
Contributor Author

OmarBasem commented Aug 19, 2022

I don't understand why it cannot be built now (for iOS) after rebasing.

make lint is passing
make test is passing
There are no conflicts.
App is building and running locally with no problem.

@flexsurfer
Copy link
Member

flexsurfer commented Sep 1, 2022

hey @OmarBasem sorry for late response, could you please rebase, and try make test locally , seems like tests failed

@OmarBasem
Copy link
Contributor Author

hey @OmarBasem sorry for late response, could you please rebase, and try make test locally, seems like tests failed

@flexsurfer As mentioned above, I have already tried rebasing 3 times, but iOS build kept failing.
make lint was passing
make test was passing
There were no conflicts.
App was building and running locally with no problem.

@Parveshdhull
Copy link
Member

Parveshdhull commented Sep 5, 2022

but iOS build kept failing.

Hi @OmarBasem, there was problem with ios build, now fixed in #13912

Also, looks like other failed builds are due to the issue mentioned in #13620 (comment) .
Because build succeed, its that below section is showing result of first build not current one.

This one is also fixed in #13926

Please can you try rebase now, builds should work fine.

@flexsurfer
Copy link
Member

hey @OmarBasem you need to update status go version

@OmarBasem
Copy link
Contributor Author

hey @OmarBasem you need to update status go version

I see all checks have passed. It is the same version v0.107.1.

@status-im-auto
Copy link
Member

100% of end-end tests have passed

Total executed tests: 87
Failed tests: 0
Passed tests: 87

Passed tests (87)

Click to expand

Class TestPublicChatMultipleDeviceMerged:

1. test_public_chat_link_send_open, id: 700736
Device sessions

2. test_public_chat_message_delete, id: 700735
Device sessions

3. test_public_chat_unread_messages_counter, id: 5360
Device sessions

4. test_public_chat_unread_messages_counter_for_mention_relogin, id: 700718
Device sessions

5. test_public_chat_delete_chat_long_press, id: 5319
Device sessions

6. test_public_chat_message_send_check_timestamps_while_on_different_tab, id: 5313
Device sessions

7. test_public_chat_emoji_send_copy_paste_reply, id: 700719
Device sessions

8. test_public_chat_mark_all_messages_as_read, id: 6270
Device sessions

9. test_public_chat_links_with_previews_github_youtube_twitter_gif_send_enable, id: 700737
Device sessions

10. test_public_chat_message_edit, id: 700734
Device sessions

Class TestRestoreOneDeviceMerged:

1. test_restore_account_migrate_multiaccount_to_keycard_no_db_saved_add_wallet_send_tx, id: 702189
Device sessions

2. test_restore_uppercase_whitespaces_seed_phrase_special_char_passw_logcat, id: 700748
Device sessions

3. test_restore_set_up_wallet_sign_phrase, id: 700749
Device sessions

4. test_restore_seed_phrase_field_validation, id: 700750
Device sessions

Class TestPublicChatBrowserOneDeviceMerged:

1. test_browser_connection_is_secure_not_secure_warning, id: 702073
Device sessions

2. test_public_chat_copy_and_paste_message_in_chat_input, id: 5317
Device sessions

3. test_browser_invalid_url, id: 702074
Device sessions

4. test_browser_bookmarks_create_edit_remove, id: 702077
Device sessions

5. test_public_chat_tag_message, id: 700738
Device sessions

6. test_browser_offline, id: 702075
Device sessions

7. test_public_chat_navigate_to_chat_when_relaunch, id: 5396
Device sessions

8. test_public_chat_open_using_deep_link, id: 700739
Device sessions

9. test_browser_delete_close_tabs, id: 702076
Device sessions

10. test_browser_blocked_url, id: 702072
Device sessions

11. test_browser_web3_permissions_testdapp, id: 702078
Device sessions

12. test_public_chat_fetch_more_history, id: 5675
Device sessions

Class TestKeycardTxOneDeviceMerged:

1. test_keycard_send_tx_eth, id: 700767
Device sessions

2. test_keycard_create_account_unlock_same_seed, id: 5689
Device sessions

3. test_keycard_wallet_recover_pairing_check_balance_after_offline_tx_history, id: 700770
Device sessions

4. test_keycard_relogin_after_restore, id: 700768
Device sessions

5. test_keycard_send_tx_sign_message_request_stt_testdapp, id: 700769
Device sessions

Class TestPairingSyncMultipleDevicesMerged:

1. test_pairing_sync_contacts_add_remove_set_nickname_ens, id: 702197
Device sessions

2. test_pairing_sync_clear_history, id: 702394
Device sessions

3. test_pairing_sync_initial_bookmarks, id: 702393
Device sessions

4. test_pairing_sync_initial_profile_picture, id: 702392
Device sessions

5. test_pairing_sync_contacts_block_unblock, id: 702196
Device sessions

6. test_pairing_sync_initial_contacts_blocked_users, id: 702194
Device sessions

7. test_pairing_sync_initial_public_chats, id: 702195
Device sessions

8. test_pairing_sync_public_chat_add_remove, id: 702199
Device sessions

9. test_pairing_sync_1_1_chat_message, id: 702198
Device sessions

Class TestEnsStickersMultipleDevicesMerged:

1. test_start_new_chat_public_key_validation, id: 702158
Device sessions

2. test_sticker_1_1_public_chat_mainnet, id: 702157
Device sessions

3. test_ens_command_send_tx_eth_1_1_chat, id: 702153
Device sessions

4. test_ens_mention_push_highlighted_public_chat, id: 702156
Device sessions

5. test_ens_mention_nickname_1_1_chat, id: 702155
Device sessions

6. test_ens_purchased_in_profile, id: 702152
Device sessions

Class TestOneToOneChatMultipleSharedDevices:

1. test_1_1_chat_push_emoji, id: 6283
Device sessions

2. test_1_1_chat_image_send_save_reply, id: 6305
Device sessions

3. test_1_1_chat_is_shown_message_sent_delivered_from_offline, id: 5310
Device sessions

4. test_1_1_chat_message_reaction, id: 6315
Device sessions

5. test_1_1_chat_delete_via_delete_button_relogin, id: 5387
Device sessions

6. test_1_1_chat_emoji_send_reply_and_open_link, id: 5373
Device sessions

7. test_1_1_chat_non_latin_message_to_newly_added_contact_with_profile_picture_on_different_networks, id: 5315
Device sessions

8. test_1_1_chat_text_message_edit_delete_push_disappear, id: 695843
Device sessions

9. test_1_1_chat_text_message_with_push, id: 6316
Device sessions

Class TestContactBlockMigrateKeycardMultipleSharedDevices:

1. test_keycard_command_send_tx_eth_1_1_chat, id: 702186
Device sessions

2. test_contact_block_unblock_public_chat_offline, id: 702176
Device sessions

3. test_contact_add_remove_mention_default_username_nickname_public_chat, id: 702175
Device sessions

4. test_cellular_settings_on_off_public_chat_fetching_history, id: 702188
Device sessions

5. test_restore_account_migrate_multiaccount_to_keycard_db_saved, id: 702177
Device sessions

Class TestSendTxDeviceMerged:

1. test_send_tx_custom_token_18_decimals_invalid_password, id: 700765
Device sessions

2. test_send_tx_token_8_decimals, id: 700764
Device sessions

3. test_send_tx_set_recipient_options, id: 700757
Device sessions

4. test_send_tx_eth_check_logcat, id: 700763
Device sessions

5. test_send_tx_sign_message_2tx_in_batch_tx_filters_request_stt_testdapp, id: 5342
Device sessions

Class TestOnboardingOneDeviceMerged:

1. test_onboarding_share_contact_address, id: 700743
Device sessions

2. test_onboarding_add_new_multiaccount_username_by_position_pass_validation, id: 700747
Device sessions

3. test_onboarding_cant_sign_in_with_invalid_password_logcat, id: 700746
Device sessions

4. test_onboarding_share_wallet_address, id: 700744
Device sessions

5. test_onboarding_home_initial_popup, id: 700742
Device sessions

6. test_onboarding_backup_seed_phrase_restore_same_login_logcat, id: 700745
Device sessions

Class TestGroupChatMultipleDeviceMerged:

1. test_group_chat_leave_relogin, id: 3997
Device sessions

2. test_group_chat_highligted, id: 5756
Device sessions

3. test_group_chat_push_system_messages_when_invited, id: 3994
Device sessions

4. test_group_chat_join_send_text_messages_push, id: 700731
Device sessions

5. test_group_chat_add_new_member_activity_centre, id: 700732
Device sessions

6. test_group_chat_offline_pn, id: 3998
Device sessions

Class TestCommandsMultipleDevicesMerged:

1. test_1_1_chat_command_send_tx_eth_outgoing_tx_push, id: 6253
Device sessions

2. test_1_1_chat_command_decline_eth_push_changing_state, id: 6265
Device sessions

3. test_1_1_chat_command_request_and_send_tx_stt_in_1_1_chat_offline, id: 6263
Device sessions

Class TestWalletManagementDeviceMerged:

1. test_wallet_add_account_generate_new, id: 700759
Device sessions

2. test_wallet_add_hide_unhide_account_private_key, id: 700761
Device sessions

3. test_wallet_add_delete_watch_only_account, id: 700760
Device sessions

4. test_wallet_tx_history_copy_tx_hash_on_cellular, id: 700756
Device sessions

5. test_wallet_fetching_balance_after_offline_insufficient_funds_errors, id: 700766
Device sessions

6. test_wallet_add_account_seed_phrase_validation, id: 700762
Device sessions

7. test_wallet_manage_assets, id: 700758
Device sessions

@flexsurfer
Copy link
Member

but I suppose this PR depends on status-im/status-go#2771 ? so version from PR should be used?

@OmarBasem
Copy link
Contributor Author

but I suppose this PR depends on status-im/status-go#2771 ? so version from PR should be used?

@flexsurfer That's what I had when I first made the PR, but it was causing merge conflicts. Shall I update it now?

@flexsurfer
Copy link
Member

yes, please

@OmarBasem
Copy link
Contributor Author

i guess your changes already in latest go version so you could just use latest version

@flexsurfer is status-mobile develop branch using latest status-go develop branch?

@flexsurfer
Copy link
Member

i think yes

@OmarBasem
Copy link
Contributor Author

i think yes

Apparently not. The develop branch is currently using an older commit. I updated it to the corresponding commit.

@flexsurfer
Copy link
Member

hey @OmarBasem please fix make lint , and also one question, is this PR can be tested in the new UI ?

@OmarBasem
Copy link
Contributor Author

hey @OmarBasem please fix make lint , and also one question, is this PR can be tested in the new UI ?

@flexsurfer What do you mean can be tested in the new UI? This PR is implementing old UI functionalities

@flexsurfer
Copy link
Member

ok , @OmarBasem lets then merge it, because we don't test old ui anymore

@flexsurfer
Copy link
Member

but you need to bump version in status-go, so we can use it

@OmarBasem
Copy link
Contributor Author

but you need to bump version in status-go, so we can use it

Yes I already did

@OmarBasem OmarBasem merged commit 3aaa7e4 into status-im:develop Oct 18, 2022
ibrkhalil pushed a commit that referenced this pull request Oct 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Add missing actions (edit/delete/reply) to certain types of messages (emoji/sticker/audio)
6 participants