status-mobile icon indicating copy to clipboard operation
status-mobile copied to clipboard

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

Open OmarBasem opened this issue 3 years ago • 16 comments

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

OmarBasem avatar Aug 16 '22 13:08 OmarBasem

Jenkins Builds

Click to see older builds (53)
:grey_question: Commit :hash: Finished (UTC) Duration Platform Result
:heavy_check_mark: b1394fe3 #1 2022-08-16 13:29:59 ~8 min android :package:apk :calling:
:heavy_check_mark: b1394fe3 #1 2022-08-16 13:31:11 ~9 min android-e2e :package:apk :calling:
:heavy_check_mark: b1394fe3 #1 2022-08-16 13:32:31 ~10 min ios :package:ipa :calling:
:heavy_multiplication_x: 33acefe8 #2 2022-08-16 14:30:38 ~7 min android-e2e :package:apk :calling:
:heavy_multiplication_x: 33acefe8 #2 2022-08-16 14:31:04 ~7 min android :package:apk :calling:
:heavy_multiplication_x: 33acefe8 #2 2022-08-16 14:33:10 ~9 min ios :package:ipa :calling:
:heavy_check_mark: f425d6dc #3 2022-08-16 14:48:03 ~7 min android :package:apk :calling:
:heavy_check_mark: f425d6dc #3 2022-08-16 14:48:48 ~8 min android-e2e :package:apk :calling:
:heavy_check_mark: f425d6dc #3 2022-08-16 14:55:37 ~15 min ios :package:ipa :calling:
:heavy_check_mark: a0ef7dab #4 2022-08-18 10:28:22 ~15 min android-e2e :package:apk :calling:
:heavy_check_mark: a0ef7dab #4 2022-08-18 10:29:29 ~16 min android :package:apk :calling:
:heavy_check_mark: a0ef7dab #4 2022-08-18 10:34:23 ~21 min ios :package:ipa :calling:
:heavy_check_mark: 6581d2a9 #5 2022-08-19 05:29:06 ~7 min android-e2e :package:apk :calling:
:heavy_check_mark: 6581d2a9 #5 2022-08-19 05:29:15 ~7 min android :package:apk :calling:
:x: 6581d2a9 #5 2022-08-19 05:32:29 ~10 min ios :page_facing_up:log
:x: 6581d2a9 #6 2022-08-19 06:07:43 ~11 min ios :page_facing_up:log
:heavy_check_mark: 40a39e8e #6 2022-08-19 07:20:45 ~7 min android-e2e :package:apk :calling:
:heavy_check_mark: 40a39e8e #6 2022-08-19 07:21:20 ~7 min android :package:apk :calling:
:x: 40a39e8e #7 2022-08-19 07:25:47 ~12 min ios :page_facing_up:log
:heavy_check_mark: f6dd8907 #7 2022-08-19 07:56:45 ~9 min android :package:apk :calling:
:x: f6dd8907 #8 2022-08-19 08:00:29 ~12 min ios :page_facing_up:log
:heavy_check_mark: ea2c5852 #8 2022-08-20 06:28:30 ~7 min android :package:apk :calling:
:heavy_check_mark: ea2c5852 #8 2022-08-20 06:28:51 ~8 min android-e2e :package:apk :calling:
:x: ea2c5852 #9 2022-08-20 06:37:38 ~17 min ios :page_facing_up:log
:x: ea2c5852 #1 2022-09-02 12:10:44 ~20 min android :page_facing_up:log
:heavy_check_mark: 3a8ac538 #2 2022-09-05 13:19:54 ~2 min tests :package:log
:heavy_check_mark: 3a8ac538 #2 2022-09-05 13:26:20 ~8 min android-e2e :package:apk :calling:
:heavy_check_mark: 3a8ac538 #2 2022-09-05 13:26:47 ~9 min android :package:apk :calling:
:heavy_check_mark: 3a8ac538 #2 2022-09-05 13:33:15 ~15 min ios :package:ipa :calling:
:heavy_check_mark: 88dbb01b #3 2022-09-06 08:25:25 ~3 min tests :package:log
:heavy_check_mark: 88dbb01b #3 2022-09-06 08:31:05 ~9 min android :package:apk :calling:
:heavy_check_mark: 88dbb01b #3 2022-09-06 08:32:34 ~11 min android-e2e :package:apk :calling:
:heavy_check_mark: 88dbb01b #3 2022-09-06 08:45:25 ~23 min ios :package:ipa :calling:
:heavy_check_mark: 9d4c7187 #4 2022-09-06 09:15:59 ~2 min tests :package:log
:heavy_check_mark: 9d4c7187 #4 2022-09-06 09:21:31 ~8 min android-e2e :package:apk :calling:
:heavy_check_mark: 9d4c7187 #4 2022-09-06 09:22:09 ~9 min android :package:apk :calling:
:heavy_check_mark: 9d4c7187 #4 2022-09-06 09:26:52 ~13 min ios :package:ipa :calling:
:heavy_check_mark: 7477853c #5 2022-10-10 16:21:44 ~2 min tests :package:log
:heavy_check_mark: 7477853c #5 2022-10-10 16:27:19 ~7 min android-e2e :package:apk :calling:
:heavy_check_mark: 7477853c #5 2022-10-10 16:27:24 ~7 min android :package:apk :calling:
:heavy_check_mark: 7477853c #5 2022-10-10 16:32:11 ~12 min ios :package:ipa :calling:
:x: 58d51fdc #6 2022-10-17 10:54:15 ~14 sec ios :page_facing_up:log
:x: 58d51fdc #6 2022-10-17 10:54:18 ~17 sec android-e2e :page_facing_up:log
:x: 58d51fdc #6 2022-10-17 10:54:32 ~31 sec tests :page_facing_up:log
:x: 58d51fdc #6 2022-10-17 10:54:32 ~32 sec android :page_facing_up:log
:x: f016e8ea #7 2022-10-17 10:55:23 ~13 sec ios :page_facing_up:log
:x: f016e8ea #7 2022-10-17 10:55:24 ~14 sec android-e2e :page_facing_up:log
:x: f016e8ea #7 2022-10-17 10:55:41 ~31 sec android :page_facing_up:log
:x: f016e8ea #7 2022-10-17 10:55:42 ~27 sec tests :page_facing_up:log
:heavy_check_mark: c128d710 #8 2022-10-17 11:02:03 ~3 min tests :package:log
:heavy_check_mark: c128d710 #8 2022-10-17 11:08:07 ~9 min android :package:apk :calling:
:heavy_check_mark: c128d710 #8 2022-10-17 11:08:37 ~10 min android-e2e :package:apk :calling:
:heavy_check_mark: c128d710 #8 2022-10-17 11:13:02 ~14 min ios :package:ipa :calling:
:grey_question: Commit :hash: Finished (UTC) Duration Platform Result
:x: e36d1ef9 #9 2022-10-18 05:53:11 ~2 min tests :page_facing_up:log
:heavy_check_mark: e36d1ef9 #9 2022-10-18 05:57:39 ~7 min android :package:apk :calling:
:heavy_check_mark: e36d1ef9 #9 2022-10-18 05:58:29 ~8 min android-e2e :package:apk :calling:
:heavy_check_mark: e36d1ef9 #9 2022-10-18 06:03:44 ~13 min ios :package:ipa :calling:
:heavy_check_mark: 15cf496f #11 2022-10-18 12:25:35 ~10 min tests :package:log
:heavy_check_mark: 15cf496f #11 2022-10-18 12:28:35 ~13 min android-e2e :package:apk :calling:
:heavy_check_mark: 15cf496f #11 2022-10-18 12:28:52 ~13 min android :package:apk :calling:
:heavy_check_mark: 15cf496f #11 2022-10-18 12:37:39 ~22 min ios :package:ipa :calling:

status-im-auto avatar Aug 16 '22 13:08 status-im-auto

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

OmarBasem avatar Aug 16 '22 13:08 OmarBasem

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

flexsurfer avatar Aug 19 '22 05:08 flexsurfer

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 avatar Aug 19 '22 08:08 OmarBasem

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.

OmarBasem avatar Aug 19 '22 08:08 OmarBasem

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

flexsurfer avatar Sep 01 '22 10:09 flexsurfer

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.

OmarBasem avatar Sep 05 '22 10:09 OmarBasem

but iOS build kept failing.

Hi @OmarBasem, there was problem with ios build, now fixed in https://github.com/status-im/status-mobile/pull/13912

Also, looks like other failed builds are due to the issue mentioned in https://github.com/status-im/status-mobile/pull/13620#discussion_r962210314 . Because build succeed, its that below section is showing result of first build not current one.

This one is also fixed in https://github.com/status-im/status-mobile/pull/13926

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

Parveshdhull avatar Sep 05 '22 10:09 Parveshdhull

hey @OmarBasem you need to update status go version

flexsurfer avatar Sep 05 '22 13:09 flexsurfer

hey @OmarBasem you need to update status go version

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

OmarBasem avatar Sep 05 '22 13:09 OmarBasem

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

status-im-auto avatar Sep 05 '22 14:09 status-im-auto

but I suppose this PR depends on https://github.com/status-im/status-go/pull/2771 ? so version from PR should be used?

flexsurfer avatar Sep 06 '22 07:09 flexsurfer

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?

OmarBasem avatar Sep 06 '22 07:09 OmarBasem

yes, please

flexsurfer avatar Sep 06 '22 07:09 flexsurfer

yes, please

@flexsurfer done

OmarBasem avatar Sep 06 '22 08:09 OmarBasem

hey @OmarBasem I've moved PR to the Review column as I see that it has not been reviewed yet. Please move it to E2E column as soon as it passes the review. After that, we will take PR into testing. Thank you!

pavloburykh avatar Sep 06 '22 09:09 pavloburykh

i know status-go has been merged, should we update and test this PR , @OmarBasem ?

flexsurfer avatar Oct 10 '22 12:10 flexsurfer

@flexsurfer yes we can do that

OmarBasem avatar Oct 10 '22 15:10 OmarBasem

@flexsurfer I am not sure if I still need to have it pointing to a specific status-go commit?

OmarBasem avatar Oct 10 '22 16:10 OmarBasem

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

flexsurfer avatar Oct 17 '22 10:10 flexsurfer

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?

OmarBasem avatar Oct 17 '22 10:10 OmarBasem

i think yes

flexsurfer avatar Oct 17 '22 10:10 flexsurfer

i think yes

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

OmarBasem avatar Oct 17 '22 11:10 OmarBasem

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

flexsurfer avatar Oct 18 '22 11:10 flexsurfer

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

OmarBasem avatar Oct 18 '22 12:10 OmarBasem

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

flexsurfer avatar Oct 18 '22 12:10 flexsurfer

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

flexsurfer avatar Oct 18 '22 12:10 flexsurfer

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

Yes I already did

OmarBasem avatar Oct 18 '22 13:10 OmarBasem