update fork to be up-to-date with matrixmc
This commit is contained in:
parent
46a4a3f51b
commit
3daadc3d10
1 changed files with 12 additions and 11 deletions
15
main.go
15
main.go
|
|
@ -370,15 +370,16 @@ func (b *Bridge) SendMessage(roomID id.RoomID, text string) {
|
|||
}
|
||||
func (b *Bridge) SendMessageWithpmp(roomID id.RoomID, displayname, text string) {
|
||||
if b.Usepmp {
|
||||
json := map[string]any{
|
||||
"msgtype": "m.text",
|
||||
"body": text,
|
||||
"com.beeper.per_message_profile": map[string]string{
|
||||
"displayname": displayname,
|
||||
"id": displayname,
|
||||
evt := &event.MessageEventContent{
|
||||
MsgType: event.MsgText,
|
||||
Body: text,
|
||||
BeeperPerMessageProfile: &event.BeeperPerMessageProfile{
|
||||
ID: displayname,
|
||||
Displayname: displayname,
|
||||
},
|
||||
}
|
||||
b.Matrix.SendMessageEvent(b.ctx, b.RoomID, event.EventMessage, json)
|
||||
evt.AddPerMessageProfileFallback()
|
||||
b.Matrix.SendMessageEvent(b.ctx, b.RoomID, event.EventMessage, evt)
|
||||
return
|
||||
}
|
||||
b.Matrix.SendText(b.ctx, b.RoomID, text)
|
||||
|
|
|
|||
Loading…
Reference in a new issue