element-hq / element-hq/dendrite
Server notice do not support `format` & `formatted_body`
- Dominant language
- Go
- Stars
- 965
- Forks
- 101
- PR merge metrics
- No merged PRs in 30d
Description
In [server_notice.go#L39](https://github.com/element-hq/dendrite/blob/e546df2e1ec9f53244a066c070ba5134af565f28/clientapi/routing/server_notices.go#L39) with only `MsgType` & `Body` defined, `format` & `formatted_body` are discarded, so format in server notice is unsupported.
In synapse, this is handled by
``` py
async def send_notice(
self,
user_id: str,
event_content: dict,
type: str = EventTypes.Message,
state_key: Optional[str] = None,
txn_id: Optional[str] = None,
)
```
By replacing dendrite's content definition to `Content map[string]interface{} `json:"content,omitempty"`` would also support format in server notices. Check . Or we could just add `format` & `formatted_body` field..
Note that [matrix spec](https://spec.matrix.org/v1.3/client-server-api/#server-notices) have `msgtype` & `body` defined only, so this is not part of matrix spec for now.
I could made a PR if the change is ok, but im not sure whether this should or not be an implement.
Contributor guide
Research direction
Start in clientapi/routing/server_notices.go around lines 37–45, then compare the current content definition with Synapse's send_notice handling and the linked commit. Confirm whether server notices should preserve format and formatted_body despite the Matrix specification, and check that the chosen representation retains the existing msgtype and body behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 50/100