status-go/signal
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
..
doc.go rename status-react to status-mobile 2022-07-17 15:37:14 +02:00
events_community_archives.go Introduce community history archive routine 2022-04-06 13:00:33 +02:00
events_discord_import.go feat: introduce messenger APIs to extract discord channels 2022-08-04 14:34:23 +02:00
events_discovery.go Dump peer infos as discovery summary 2018-05-15 13:11:28 +03:00
events_messenger.go Timeout automatic status updates (#2757) 2022-08-03 04:38:01 +05:30
events_node.go Add error to login signal (#1594) 2019-09-03 15:00:14 +02:00
events_pn.go Local notifications service (#2026) 2020-10-28 10:56:14 +03:00
events_shhext.go feat: add service for checking if there are new versions available (#2552) 2022-06-08 08:38:26 -04:00
events_sign.go Move signal logic into signal package 2018-05-03 09:35:58 +02:00
events_stats.go feat: upload/download rate for waku v1 messages (#2286) 2021-08-03 15:27:15 -04:00
events_subs.go Implement subscription for eth and shh filters using signals. (#1455) 2019-05-07 09:05:38 +02:00
events_wakuv2.go Pass connection status chan to go-waku 2021-09-23 19:00:40 +03:00
events_wallet.go Download transfers starting from latest block header (#1467) 2019-06-14 13:16:30 +03:00
ios.go Intrododuce `NodeConfig.TorrentConfig` and CLI flags 2022-03-21 12:59:09 +01:00
signals.c Gomobile support (#1164) 2019-02-01 18:02:52 +01:00
signals.go Put settings in a table with schema (#1746) 2019-12-27 10:58:25 +01:00
signals_test.go Move signal logic into signal package 2018-05-03 09:35:58 +02:00