Try to fix stuff
This commit is contained in:
parent
d97a76fcc3
commit
4270202972
3 changed files with 9 additions and 3 deletions
|
@ -227,7 +227,9 @@ func (a *Account) roomInfoUpdatedInternal(roomId RoomID, author UserID, info *Ro
|
|||
}
|
||||
|
||||
as_mxid := ezbrMxId()
|
||||
if len(author) > 0 {
|
||||
if author == a.Conn.User() {
|
||||
as_mxid = a.MatrixUser
|
||||
} else if len(author) > 0 {
|
||||
mx_user_id, err2 := dbGetMxUser(a.Protocol, author)
|
||||
if err2 == nil {
|
||||
as_mxid = mx_user_id
|
||||
|
|
|
@ -200,8 +200,12 @@ func (xm *XMPP) handleXMPP() error {
|
|||
if v.Subject != "" && v.Type == "groupchat" {
|
||||
author := UserID("")
|
||||
if len(remote_sp) == 2 {
|
||||
if remote_sp[1] == xm.nickname {
|
||||
author = xm.User()
|
||||
} else {
|
||||
author = UserID(remote_sp[1] + "@" + remote_sp[0])
|
||||
}
|
||||
}
|
||||
xm.handler.RoomInfoUpdated(RoomID(remote_sp[0]), author, &RoomInfo{
|
||||
Topic: v.Subject,
|
||||
})
|
||||
|
|
2
util.go
2
util.go
|
@ -50,7 +50,7 @@ func safeStringForId(in string) string {
|
|||
id2 += "__"
|
||||
} else if c == ':' {
|
||||
id2 += "_"
|
||||
} else if unicode.IsDigit(c) || unicode.IsLetter(c) {
|
||||
} else if unicode.IsDigit(c) || unicode.IsLetter(c) || c == '.' || c == '-' || c == '_' {
|
||||
id2 += string(c)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue