浏览代码

Don't send typing notifications if Matrix room hasn't been created

Tulir Asokan 3 年之前
父节点
当前提交
f84bb162ca
共有 1 个文件被更改,包括 5 次插入3 次删除
  1. 5 3
      user.go

+ 5 - 3
user.go

@@ -1221,9 +1221,11 @@ func (user *User) HandlePresence(info whatsapp.PresenceEvent) {
 			}
 			_, _ = puppet.IntentFor(portal).UserTyping(puppet.typingIn, false, 0)
 		}
-		puppet.typingIn = portal.MXID
-		puppet.typingAt = time.Now().Unix()
-		_, _ = puppet.IntentFor(portal).UserTyping(portal.MXID, true, 15*1000)
+		if len(portal.MXID) > 0 {
+			puppet.typingIn = portal.MXID
+			puppet.typingAt = time.Now().Unix()
+			_, _ = puppet.IntentFor(portal).UserTyping(portal.MXID, true, 15*1000)
+		}
 	}
 }