aboutsummaryrefslogtreecommitdiff
path: root/appservice/account.go
diff options
context:
space:
mode:
Diffstat (limited to 'appservice/account.go')
-rw-r--r--appservice/account.go23
1 files changed, 20 insertions, 3 deletions
diff --git a/appservice/account.go b/appservice/account.go
index ae9716f..a20751f 100644
--- a/appservice/account.go
+++ b/appservice/account.go
@@ -89,7 +89,17 @@ func (a *Account) Left(roomId RoomID) {
}
func (a *Account) UserInfoUpdated(user UserID, info *UserInfo) {
- // TODO
+ mx_user_id, err := dbGetMxUser(a.Protocol, user)
+ if err != nil {
+ return
+ }
+
+ if info.DisplayName != "" {
+ mxProfileDisplayname(mx_user_id, fmt.Sprintf("%s (%s)", info.DisplayName, a.Protocol))
+ }
+ if info.Avatar != nil {
+ // TODO
+ }
}
func (a *Account) RoomInfoUpdated(roomId RoomID, author UserID, info *RoomInfo) {
@@ -98,7 +108,7 @@ func (a *Account) RoomInfoUpdated(roomId RoomID, author UserID, info *RoomInfo)
return
}
- as_mxid := fmt.Sprintf("@%s:%s", registration.SenderLocalpart, config.MatrixDomain)
+ as_mxid := ezbrMxId()
if len(author) > 0 {
mx_user_id, err := dbGetMxUser(a.Protocol, author)
if err == nil {
@@ -109,7 +119,14 @@ func (a *Account) RoomInfoUpdated(roomId RoomID, author UserID, info *RoomInfo)
if info.Topic != "" {
mxRoomTopicAs(mx_room_id, info.Topic, as_mxid)
}
- // TODO
+
+ if info.Name != "" {
+ mxRoomNameAs(mx_room_id, info.Name, as_mxid)
+ }
+
+ if info.Picture != nil {
+ // TODO
+ }
}
func (a *Account) Event(event *Event) {