Working double puppeting

This commit is contained in:
Brandon Watson 2023-09-11 21:58:26 -05:00
parent d9fc3014b4
commit 5473d6e05d
2 changed files with 10 additions and 6 deletions

View File

@ -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`

View File

@ -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 {