change device name
This commit is contained in:
parent
2f429259bd
commit
5bf0838329
|
@ -22,7 +22,7 @@ func (user *User) updateCommunityProfile() {
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
AvatarURL string `json:"avatar_url"`
|
AvatarURL string `json:"avatar_url"`
|
||||||
ShortDescription string `json:"short_description"`
|
ShortDescription string `json:"short_description"`
|
||||||
}{"WhatsApp", user.bridge.Config.AppService.Bot.Avatar, "Your WhatsApp bridged chats"}
|
}{"Skype", user.bridge.Config.AppService.Bot.Avatar, "Your Skype bridged chats"}
|
||||||
_, err := user.bridge.Bot.MakeRequest(http.MethodPost, url, &profileReq, nil)
|
_, err := user.bridge.Bot.MakeRequest(http.MethodPost, url, &profileReq, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
user.log.Warnfln("Failed to update metadata of %s: %v", user.CommunityID, err)
|
user.log.Warnfln("Failed to update metadata of %s: %v", user.CommunityID, err)
|
||||||
|
|
|
@ -138,7 +138,7 @@ func (helper *CryptoHelper) loginBot() (*mautrix.Client, error) {
|
||||||
Type: mautrix.AuthTypeAppservice,
|
Type: mautrix.AuthTypeAppservice,
|
||||||
Identifier: mautrix.UserIdentifier{Type: mautrix.IdentifierTypeUser, User: string(helper.bridge.AS.BotMXID())},
|
Identifier: mautrix.UserIdentifier{Type: mautrix.IdentifierTypeUser, User: string(helper.bridge.AS.BotMXID())},
|
||||||
DeviceID: deviceID,
|
DeviceID: deviceID,
|
||||||
InitialDeviceDisplayName: "WhatsApp Bridge",
|
InitialDeviceDisplayName: "Skype Bridge",
|
||||||
StoreCredentials: true,
|
StoreCredentials: true,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -166,7 +166,7 @@ func (helper *CryptoHelper) loginBotOld() (*mautrix.Client, error) {
|
||||||
Identifier: mautrix.UserIdentifier{Type: mautrix.IdentifierTypeUser, User: string(helper.bridge.AS.BotMXID())},
|
Identifier: mautrix.UserIdentifier{Type: mautrix.IdentifierTypeUser, User: string(helper.bridge.AS.BotMXID())},
|
||||||
Password: hex.EncodeToString(mac.Sum(nil)),
|
Password: hex.EncodeToString(mac.Sum(nil)),
|
||||||
DeviceID: deviceID,
|
DeviceID: deviceID,
|
||||||
InitialDeviceDisplayName: "WhatsApp Bridge",
|
InitialDeviceDisplayName: "Skype Bridge",
|
||||||
StoreCredentials: true,
|
StoreCredentials: true,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -51,8 +51,8 @@ func (puppet *Puppet) loginWithSharedSecret(mxid id.UserID) (string, error) {
|
||||||
Type: "m.login.password",
|
Type: "m.login.password",
|
||||||
Identifier: mautrix.UserIdentifier{Type: "m.id.user", User: string(mxid)},
|
Identifier: mautrix.UserIdentifier{Type: "m.id.user", User: string(mxid)},
|
||||||
Password: hex.EncodeToString(mac.Sum(nil)),
|
Password: hex.EncodeToString(mac.Sum(nil)),
|
||||||
DeviceID: "WhatsApp Bridge",
|
DeviceID: "Skype Bridge",
|
||||||
InitialDeviceDisplayName: "WhatsApp Bridge",
|
InitialDeviceDisplayName: "Skype Bridge",
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
|
|
2
user.go
2
user.go
|
@ -183,7 +183,7 @@ func (user *User) GetManagementRoom() id.RoomID {
|
||||||
return user.ManagementRoom
|
return user.ManagementRoom
|
||||||
}
|
}
|
||||||
resp, err := user.bridge.Bot.CreateRoom(&mautrix.ReqCreateRoom{
|
resp, err := user.bridge.Bot.CreateRoom(&mautrix.ReqCreateRoom{
|
||||||
Topic: "WhatsApp bridge notices",
|
Topic: "Skype bridge notices",
|
||||||
IsDirect: true,
|
IsDirect: true,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue