Skip to content

Commit

Permalink
feat: recgonize 0x00001 as system mention
Browse files Browse the repository at this point in the history
This "id" or "tag" will be interpeted/interpolated as `@everyone` by
clients.

For this change to work

status-im/markdown#5

is needed.
  • Loading branch information
0x-r4bbit committed Dec 19, 2022
1 parent b1ff13e commit 7f210fb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion protocol/common/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ const (
ContactVerificationStateCanceled
)

const everyoneMentionTag = "0x00001"

type CommandParameters struct {
// ID is the ID of the initial message
ID string `json:"id"`
Expand Down Expand Up @@ -470,7 +472,7 @@ func (v *MentionsAndLinksVisitor) Visit(node ast.Node, entering bool) ast.WalkSt
switch n := node.(type) {
case *ast.Mention:
mention := string(n.Literal)
if mention == v.identity {
if mention == v.identity || mention == everyoneMentionTag {
v.mentioned = true
}
v.mentions = append(v.mentions, mention)
Expand Down

0 comments on commit 7f210fb

Please sign in to comment.