aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2020-02-18 18:14:48 +0100
committerAlex Auvolat <alex@adnab.me>2020-02-18 18:17:08 +0100
commit65ddb6be2bafecad1d58bb00cab6020a5df3da0e (patch)
tree69dd2b84f8c6a42f48bb3d0d0a2991fb5ab55e62
parent1370a6b35fd3e805385ea0e3ad674052627cd1f3 (diff)
downloadeasybridge-65ddb6be2bafecad1d58bb00cab6020a5df3da0e.tar.gz
easybridge-65ddb6be2bafecad1d58bb00cab6020a5df3da0e.zip
Do not set room name for PM room
-rw-r--r--appservice/db.go2
-rw-r--r--appservice/matrix.go5
-rw-r--r--appservice/server.go2
-rw-r--r--mxlib/api.go3
4 files changed, 5 insertions, 7 deletions
diff --git a/appservice/db.go b/appservice/db.go
index 1c68e6f..6423b95 100644
--- a/appservice/db.go
+++ b/appservice/db.go
@@ -125,7 +125,7 @@ func dbGetMxPmRoom(protocol string, them connector.UserID, themMxId string, usMx
if must_create {
name := fmt.Sprintf("%s (%s)", them, protocol)
- mx_room_id, err := mxCreateDirectRoomAs(name, []string{usMxId}, themMxId)
+ mx_room_id, err := mxCreateDirectRoomAs([]string{usMxId}, themMxId)
if err != nil {
log.Printf("Could not create room for %s: %s", name, err)
return "", err
diff --git a/appservice/matrix.go b/appservice/matrix.go
index b2da2f2..6b99992 100644
--- a/appservice/matrix.go
+++ b/appservice/matrix.go
@@ -179,10 +179,9 @@ func mxCreateRoom(name string, alias string, invite []string) (string, error) {
return rep.RoomId, nil
}
-func mxCreateDirectRoomAs(name string, invite []string, as_user string) (string, error) {
- rq := CreateRoomNoAliasRequest{
+func mxCreateDirectRoomAs(invite []string, as_user string) (string, error) {
+ rq := CreateDirectRoomRequest{
Preset: "private_chat",
- Name: name,
Topic: "",
Invite: invite,
CreationContent: map[string]interface{}{
diff --git a/appservice/server.go b/appservice/server.go
index 42dd78b..aa43935 100644
--- a/appservice/server.go
+++ b/appservice/server.go
@@ -37,7 +37,7 @@ func Start(r *mxlib.Registration, c *Config) (chan error, error) {
if mxe, ok := err.(*mxlib.MxError); !ok || mxe.ErrCode != "M_USER_IN_USE" {
return nil, err
}
- err = mxProfileDisplayname(ezbrMxId(), "Easybridge")
+ err = mxProfileDisplayname(ezbrMxId(), fmt.Sprintf("Easybridge (%s)", EASYBRIDGE_SYSTEM_PROTOCOL))
if err != nil {
return nil, err
}
diff --git a/mxlib/api.go b/mxlib/api.go
index c7061b3..6dfe56e 100644
--- a/mxlib/api.go
+++ b/mxlib/api.go
@@ -50,9 +50,8 @@ type CreateRoomRequest struct {
PowerLevels map[string]interface{} `json:"power_level_content_override"`
}
-type CreateRoomNoAliasRequest struct {
+type CreateDirectRoomRequest struct {
Preset string `json:"preset"`
- Name string `json:"name"`
Topic string `json:"topic"`
Invite []string `json:"invite"`
CreationContent map[string]interface{} `json:"creation_content"`