Add database migrations and handle leaving private chat portals. Fixes #7

This commit is contained in:
Tulir Asokan
2019-05-16 20:14:32 +03:00
parent 97e740d93d
commit b0d774a5a5
13 changed files with 279 additions and 108 deletions

View File

@ -47,6 +47,10 @@ type User struct {
}
func (bridge *Bridge) GetUserByMXID(userID types.MatrixUserID) *User {
_, isPuppet := bridge.ParsePuppetMXID(userID)
if isPuppet || userID == bridge.Bot.UserID {
return nil
}
bridge.usersLock.Lock()
defer bridge.usersLock.Unlock()
user, ok := bridge.usersByMXID[userID]