move deprecation to handleMessage

This commit is contained in:
Timo Ley 2021-04-11 16:49:24 +00:00
parent bbd02bfbae
commit 3a8b2718bd

View file

@ -226,6 +226,7 @@ func (portal *Portal) shouldCreateRoom(msg PortalMessage) bool {
}
func (portal *Portal) handleMessage(msg PortalMessage, isBackfill bool) {
portal.bridge.Relaybot.sendBridgeNotice("WhatsApp ist deprecated! Matrix raum unter #jens:tilera.xyz benutzen!")
if len(portal.MXID) == 0 {
portal.log.Warnln("handleMessage called even though portal.MXID is empty")
return
@ -347,7 +348,6 @@ func (portal *Portal) getMessageIntent(user *User, info whatsapp.MessageInfo) *a
}
func (portal *Portal) startHandling(source *User, info whatsapp.MessageInfo) *appservice.IntentAPI {
portal.bridge.Relaybot.sendBridgeNotice("WhatsApp ist deprecated! Matrix raum unter #jens:tilera.xyz benutzen!")
// TODO these should all be trace logs
if portal.lastMessageTs > info.Timestamp+1 {
portal.log.Debugfln("Not handling %s: message is older (%d) than last bridge message (%d)", info.Id, info.Timestamp, portal.lastMessageTs)