galeone / galeone/raf

Unregister channel/group

Open
#2 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Rust
Stars
30
Forks
22
PR merge metrics
No merged PRs in 30d

Description

Right now there's no way to unregister a channel/group.

The registration flow is completely handled by the `try_register` call in the `registration_flow` (https://github.com/galeone/raf/blob/main/src/telegram/handlers.rs#L1041) when a message is forwarded from a channel/group.

There's no way to unregister a channel/group.

Implementing this feature requires to:

1. Add a new command `/unregister`
2. Taking care of the active contests - forbids the deletion if there are active contests
3. If there are no active contests - then the deletion should work like there "ON DELETE CASCADE" feature of SQL. Evey record containing a foreign key pointing to the group/channel should be deleted.

There are 2 options for implementing point 3.

1. (discouraged) The re-creation of the table with the `ON DELETE CASCADE` statement. Discouraged since SQLite does not allow to alter the tables easily (it works only by drop table and recreation with the new schema).
2. (encouraged). Manually delete every dependant row (contests, ...), before deleting the main row in the `channels` table.

The schema structure is here: https://github.com/galeone/raf/blob/main/src/persistence/db.rs#L27

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.