Skip to content

Server notice do not support format & formatted_bodyΒ #3643

@dedfaf

Description

@dedfaf

In server_notice.go#L39 with only MsgType & Body defined, format & formatted_body are discarded, so format in server notice is unsupported.

type sendServerNoticeRequest struct {
UserID string `json:"user_id,omitempty"`
Content struct {
MsgType string `json:"msgtype,omitempty"`
Body string `json:"body,omitempty"`
} `json:"content,omitempty"`
Type string `json:"type,omitempty"`
StateKey string `json:"state_key,omitempty"`
}

In synapse, this is handled by

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 dedfaf@3c528cb. Or we could just add format & `formatted_body` field..

Note that matrix spec 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions