diff --git a/example-config.yaml b/example-config.yaml index f9cded5..2886199 100644 --- a/example-config.yaml +++ b/example-config.yaml @@ -157,6 +157,9 @@ bridge: default_bridge_receipts: true default_bridge_presence: true # Shared secret for https://github.com/devture/matrix-synapse-shared-secret-auth + + login_shared_secret_map: + example.com: null # # If set, custom puppets will be enabled automatically for local users # instead of users having to find an access token and run `login-matrix` diff --git a/portal.go b/portal.go index beda107..7f6f124 100644 --- a/portal.go +++ b/portal.go @@ -215,7 +215,8 @@ func (portal *Portal) SyncDM(user *User, dm *groupme.Chat) { //} update := false - update = portal.UpdateName(dm.OtherUser.Name, "", false) || update + + update = portal.updateMetadata(user) || update update = portal.UpdateAvatar(user, dm.OtherUser.AvatarURL, false) || update if update { @@ -827,10 +828,6 @@ func (portal *Portal) handleAttachment(intent *appservice.IntentAPI, attachment // Private Methods -func (portal *Portal) createMatrixRoomForDM(user *User, puppet *Puppet) { - -} - func (portal *Portal) createMatrixRoom(user *User) error { portal.roomCreateLock.Lock() defer portal.roomCreateLock.Unlock() @@ -943,7 +940,11 @@ func (portal *Portal) markHandled(source *User, message *groupme.Message, mxid i func (portal *Portal) getMessageIntent(user *User, info *groupme.Message) *appservice.IntentAPI { if portal.IsPrivateChat() { if info.UserID == user.GetGMID() { //from me - return portal.bridge.GetPuppetByGMID(user.GMID).DefaultIntent() + puppet := portal.bridge.GetPuppetByGMID(user.GMID) + if len(puppet.CustomMXID) > 0 { + return puppet.customIntent + } + return puppet.DefaultIntent() } return portal.MainIntent() } else if len(info.UserID.String()) == 0 {