瀏覽代碼

Fix double puppeting.

This was caused by some early attempts at not replaying messages. That was
fixed by tracking messages explicitly but these early returns with no logging
were never removed.

Fixes #23
Gary Kramlich 3 年之前
父節點
當前提交
f39226c665
共有 2 個文件被更改,包括 2 次插入5 次删除
  1. 1 4
      bridge/portal.go
  2. 1 1
      bridge/puppet.go

+ 1 - 4
bridge/portal.go

@@ -226,6 +226,7 @@ func (p *Portal) createMatrixRoom(user *User, channel *discordgo.Channel) error
 		CreationContent: creationContent,
 		CreationContent: creationContent,
 	})
 	})
 	if err != nil {
 	if err != nil {
+		p.log.Warnln("Failed to create room:", err)
 		return err
 		return err
 	}
 	}
 
 
@@ -387,10 +388,6 @@ func (p *Portal) handleDiscordAttachment(intent *appservice.IntentAPI, msgID str
 }
 }
 
 
 func (p *Portal) handleDiscordMessageCreate(user *User, msg *discordgo.Message) {
 func (p *Portal) handleDiscordMessageCreate(user *User, msg *discordgo.Message) {
-	if msg.Author != nil && user.ID == msg.Author.ID {
-		return
-	}
-
 	if p.MXID == "" {
 	if p.MXID == "" {
 		p.log.Warnln("handle message called without a valid portal")
 		p.log.Warnln("handle message called without a valid portal")
 
 

+ 1 - 1
bridge/puppet.go

@@ -153,7 +153,7 @@ func (p *Puppet) DefaultIntent() *appservice.IntentAPI {
 }
 }
 
 
 func (p *Puppet) IntentFor(portal *Portal) *appservice.IntentAPI {
 func (p *Puppet) IntentFor(portal *Portal) *appservice.IntentAPI {
-	if p.customIntent == nil || portal.Key.Receiver == p.ID {
+	if p.customIntent == nil {
 		return p.DefaultIntent()
 		return p.DefaultIntent()
 	}
 	}