fix(buzz-cli): p-tag DM recipients on messages send - #4738
Open
rithvikshettyy wants to merge 2 commits into
Open
fix(buzz-cli): p-tag DM recipients on messages send#4738rithvikshettyy wants to merge 2 commits into
rithvikshettyy wants to merge 2 commits into
Conversation
cmd_send_message only emitted p tags for explicit @mentions, so a plain DM message (no @mention in content) carried none. Desktop p-tags DM sends unconditionally; the CLI now matches by looking up the channel's kind:41001 DM record and auto-tagging the other participant(s) when sending a kind-9/default message. Fixes block#4704 Signed-off-by: rithvik shetty <rithvikshetty2004@gmail.com>
Signed-off-by: rithvik shetty <rithvikshetty2004@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
buzz messages send --channel <dm-id>only p-tagged explicit@mentions, so a plain DM message carried noptag at all — the recipient'sdms listnever showed the conversation, and p-tag-based classification (e.g. an agent gateway distinguishing DMs from broadcasts) misclassified CLI-originated DMs. Desktop already p-tags DM sends unconditionally.cmd_send_messagenow looks up the channel's kind:41001 DM record (#d=<channel_id>) for kind-9/default sends and auto-adds the other participant(s) asptags, deduped against existing mentions and excluding our own pubkey. Skipped for forum kinds (45001/45003), which can't target a DM.Test plan
cargo test -p buzz-cli— 318 passed, 0 failed, including newdm_participants_are_added_excluding_self_and_duplicatescargo fmt -p buzz-cli -- --checkcargo clippy -p buzz-cli --all-targets --all-features -- -D warnings— cleanbuzz dms open --pubkey <b>as A,buzz messages send --channel <dm-id> --content "hi"(no @mention), confirm B'sbuzz dms listshows the conversation and the event carries["p", "<A>"]— not run against a live relay from this environmentFixes #4704