Skip to content

feat(chat): Extend chat delete to remove a user DM from the chat list#32

Merged
cuiko merged 1 commit into
vika2603:mainfrom
cuiko:feat/chat-delete-dm
Jun 5, 2026
Merged

feat(chat): Extend chat delete to remove a user DM from the chat list#32
cuiko merged 1 commit into
vika2603:mainfrom
cuiko:feat/chat-delete-dm

Conversation

@cuiko

@cuiko cuiko commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • tg chat delete <ref> previously only deleted supergroups/channels (channels.deleteChannel) and errored on anything else.
  • A user/bot ref now removes that conversation from the account via messages.deleteHistory, so a DM (e.g. a blocked spammer's) can be cleared from the chat list.
  • --revoke also deletes the history on the other side. Basic legacy groups stay unsupported (use tg chat leave).
  • Confirmation prompt adapts: --revoke says "for everyone"; otherwise just "delete ?". Prompts unless --yes.

Test plan

  • go build ./..., go vet, golangci-lint run, go test ./...
  • Unit: --revoke pass-through; existing confirm/decline tests still pass.
  • Live: deleted a real user DM with chat delete <user> --yes; the peer disappeared from tg inbox (present before → absent after), confirming deleteHistory removed the dialog from the chat list.

`tg chat delete <ref>` previously only deleted supergroups/channels via
channels.deleteChannel and errored on anything else. Now a user/bot ref
removes that conversation from the account via messages.deleteHistory, so a
DM (e.g. a blocked spammer's) can be cleared from the chat list. --revoke
also deletes the history on the other side. Basic groups stay unsupported
(use `tg chat leave`).
@cuiko
cuiko merged commit 81f9fa0 into vika2603:main Jun 5, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant