mirror of
https://github.com/tulir/mautrix-whatsapp
synced 2024-12-17 02:43:49 +01:00
Change incoming call notices back to m.text
This commit is contained in:
parent
c0fc06b410
commit
e4bc254a65
2 changed files with 13 additions and 3 deletions
|
@ -919,7 +919,14 @@ func (portal *Portal) HandleFakeMessage(source *User, message FakeMessage) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err := portal.MainIntent().SendNotice(portal.MXID, message.Text)
|
content := event.MessageEventContent{
|
||||||
|
MsgType: event.MsgNotice,
|
||||||
|
Body: message.Text,
|
||||||
|
}
|
||||||
|
if message.Alert {
|
||||||
|
content.MsgType = event.MsgText
|
||||||
|
}
|
||||||
|
_, err := portal.sendMainIntentMessage(content)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
portal.log.Errorfln("Failed to handle fake message %s: %v", message.ID, err)
|
portal.log.Errorfln("Failed to handle fake message %s: %v", message.ID, err)
|
||||||
return
|
return
|
||||||
|
|
7
user.go
7
user.go
|
@ -675,8 +675,9 @@ func (user *User) HandleMessageRevoke(message whatsappExt.MessageRevocation) {
|
||||||
}
|
}
|
||||||
|
|
||||||
type FakeMessage struct {
|
type FakeMessage struct {
|
||||||
Text string
|
Text string
|
||||||
ID string
|
ID string
|
||||||
|
Alert bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func (user *User) HandleCallInfo(info whatsappExt.CallInfo) {
|
func (user *User) HandleCallInfo(info whatsappExt.CallInfo) {
|
||||||
|
@ -692,11 +693,13 @@ func (user *User) HandleCallInfo(info whatsappExt.CallInfo) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
data.Text = "Incoming call"
|
data.Text = "Incoming call"
|
||||||
|
data.Alert = true
|
||||||
case whatsappExt.CallOfferVideo:
|
case whatsappExt.CallOfferVideo:
|
||||||
if !user.bridge.Config.Bridge.CallNotices.Start {
|
if !user.bridge.Config.Bridge.CallNotices.Start {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
data.Text = "Incoming video call"
|
data.Text = "Incoming video call"
|
||||||
|
data.Alert = true
|
||||||
case whatsappExt.CallTerminate:
|
case whatsappExt.CallTerminate:
|
||||||
if !user.bridge.Config.Bridge.CallNotices.End {
|
if !user.bridge.Config.Bridge.CallNotices.End {
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue