status-go/protocol/protobuf
Pascal Precht 9c568c58cf feat: introduce messenger APIs to extract discord channels
As part of the new Discord <-> Status Community Import functionality,
we're adding an API that extracts all discord categories and channels
from a previously exported discord export file.

These APIs can be used in clients to show the user what categories and
channels will be imported later on.

There are two APIs:

1. `Messenger.ExtractDiscordCategoriesAndChannels(filesToimport
   []string) (*MessengerResponse, map[string]*discord.ImportError)`

   This takes a list of exported discord export (JSON) files (typically one per
   channel), reads them, and extracts the categories and channels into
   dedicated data structures (`[]DiscordChannel` and `[]DiscordCategory`)

   It also returns the oldest message timestamp found in all extracted
   channels.

   The API is synchronous and returns the extracted data as
   a `*MessengerResponse`. This allows to make the API available
   status-go's RPC interface.

   The error case is a `map[string]*discord.ImportError` where each key
   is a file path of a JSON file that we tried to extract data from, and
   the value a `discord.ImportError` which holds an error message and an
   error code, allowing for distinguishing between "critical" errors and
   "non-critical" errors.

2. `Messenger.RequestExtractDiscordCategoriesAndChannels(filesToImport
   []string)`

   This is the asynchronous counterpart to
   `ExtractDiscordCategoriesAndChannels`. The reason this API has been
   added is because discord servers can have a lot of message and
   channel data, which causes `ExtractDiscordCategoriesAndChannels` to
   block the thread for too long, making apps potentially feel like they
   are stuck.

   This API runs inside a go routine, eventually calls
   `ExtractDiscordCategoriesAndChannels`, and then emits a newly
   introduced `DiscordCategoriesAndChannelsExtractedSignal` that clients
   can react to.

   Failure of extraction has to be determined by the
   `discord.ImportErrors` emitted by the signal.

**A note about exported discord history files**

We expect users to export their discord histories via the
[DiscordChatExporter](https://github.com/Tyrrrz/DiscordChatExporter/wiki/GUI%2C-CLI-and-Formats-explained#exportguild)
tool. The tool allows to export the data in different formats, such as
JSON, HTML and CSV.

We expect users to have their data exported as JSON.

Closes: https://github.com/status-im/status-desktop/issues/6690
2022-08-04 14:34:23 +02:00
..
anon_metrics.pb.go rename status-react to status-mobile 2022-07-17 15:37:14 +02:00
anon_metrics.proto rename status-react to status-mobile 2022-07-17 15:37:14 +02:00
application_metadata_message.pb.go refactor: Require request access for all communities 2022-07-08 13:16:12 +02:00
application_metadata_message.proto refactor: Require request access for all communities 2022-07-08 13:16:12 +02:00
chat_identity.pb.go refactor: Require request access for all communities 2022-07-08 13:16:12 +02:00
chat_identity.proto feat: display name 2022-03-14 13:48:34 -04:00
chat_message.pb.go feat: introduce messenger APIs to extract discord channels 2022-08-04 14:34:23 +02:00
chat_message.proto feat: introduce messenger APIs to extract discord channels 2022-08-04 14:34:23 +02:00
command.pb.go refactor: Require request access for all communities 2022-07-08 13:16:12 +02:00
command.proto Sync Communities (#2253) 2021-08-06 16:40:23 +01:00
communities.pb.go refactor: Require request access for all communities 2022-07-08 13:16:12 +02:00
communities.proto refactor: Require request access for all communities 2022-07-08 13:16:12 +02:00
contact.pb.go refactor: Require request access for all communities 2022-07-08 13:16:12 +02:00
contact.proto Initial support for mutual contact requests 2022-05-31 09:12:36 +01:00
contact_verification.pb.go refactor: Require request access for all communities 2022-07-08 13:16:12 +02:00
contact_verification.proto feat: contact verification request (#2586) 2022-07-05 15:49:44 -04:00
emoji_reaction.pb.go refactor: Require request access for all communities 2022-07-08 13:16:12 +02:00
emoji_reaction.proto Sync Communities (#2253) 2021-08-06 16:40:23 +01:00
enums.pb.go refactor: Require request access for all communities 2022-07-08 13:16:12 +02:00
enums.proto Sync Communities (#2253) 2021-08-06 16:40:23 +01:00
group_chat_invitation.pb.go refactor: Require request access for all communities 2022-07-08 13:16:12 +02:00
group_chat_invitation.proto Sync Communities (#2253) 2021-08-06 16:40:23 +01:00
membership_update_message.pb.go refactor: Require request access for all communities 2022-07-08 13:16:12 +02:00
membership_update_message.proto Sync Communities (#2253) 2021-08-06 16:40:23 +01:00
pairing.pb.go refactor: Require request access for all communities 2022-07-08 13:16:12 +02:00
pairing.proto feat: contact verification request (#2586) 2022-07-05 15:49:44 -04:00
pin_message.pb.go refactor: Require request access for all communities 2022-07-08 13:16:12 +02:00
pin_message.proto Sync Communities (#2253) 2021-08-06 16:40:23 +01:00
pubkey.go Use goimports instead of gofmt 2020-01-06 10:17:23 +01:00
push_notifications.pb.go refactor: Require request access for all communities 2022-07-08 13:16:12 +02:00
push_notifications.proto Sync Communities (#2253) 2021-08-06 16:40:23 +01:00
service.go feat: contact verification request (#2586) 2022-07-05 15:49:44 -04:00
status_update.pb.go refactor: Require request access for all communities 2022-07-08 13:16:12 +02:00
status_update.proto Online Status Indicator (#2408) 2021-10-28 20:51:28 +05:30
sync_settings.pb.go refactor: Require request access for all communities 2022-07-08 13:16:12 +02:00
sync_settings.proto Sync Settings (#2478) 2022-03-23 18:47:00 +00:00