aboutsummaryrefslogtreecommitdiff
path: root/matrix
diff options
context:
space:
mode:
authorTulir Asokan <tulir@maunium.net>2019-01-11 23:28:47 +0200
committerTulir Asokan <tulir@maunium.net>2019-01-11 23:28:47 +0200
commit331597b9f8a7942cbcb233a328301e4d5bf94fb0 (patch)
tree5ec624585ebf66c63549a098acb6f7421f1193a7 /matrix
parent2fc3378b717f40f37f3a188b68407887242d9c06 (diff)
Switch to Go modules and make other changes
Diffstat (limited to 'matrix')
-rw-r--r--matrix/matrix.go8
-rw-r--r--matrix/sync.go11
2 files changed, 15 insertions, 4 deletions
diff --git a/matrix/matrix.go b/matrix/matrix.go
index 54efd6e..b119fc9 100644
--- a/matrix/matrix.go
+++ b/matrix/matrix.go
@@ -34,7 +34,7 @@ import (
"crypto/tls"
"encoding/json"
- "gopkg.in/russross/blackfriday.v2"
+ "github.com/russross/blackfriday/v2"
"maunium.net/go/gomuks/config"
"maunium.net/go/gomuks/debug"
"maunium.net/go/gomuks/interface"
@@ -194,6 +194,10 @@ func (c *Container) OnLogin() {
debug.Print("Initializing syncer")
c.syncer = NewGomuksSyncer(c.config)
c.syncer.OnEventType(mautrix.EventMessage, c.HandleMessage)
+ c.syncer.OnEventType(mautrix.StateAliases, c.HandleMessage)
+ c.syncer.OnEventType(mautrix.StateCanonicalAlias, c.HandleMessage)
+ c.syncer.OnEventType(mautrix.StateTopic, c.HandleMessage)
+ c.syncer.OnEventType(mautrix.StateRoomName, c.HandleMessage)
c.syncer.OnEventType(mautrix.StateMember, c.HandleMembership)
c.syncer.OnEventType(mautrix.EphemeralEventReceipt, c.HandleReadReceipt)
c.syncer.OnEventType(mautrix.EphemeralEventTyping, c.HandleTyping)
@@ -290,7 +294,7 @@ func (c *Container) HandleMessage(source EventSource, evt *mautrix.Event) {
c.ui.Render()
}
} else {
- debug.Printf("Parsing event %v failed (ParseEvent() returned nil).", evt)
+ debug.Printf("Parsing event %s type %s %v from %s in %s failed (ParseEvent() returned nil).", evt.ID, evt.Type, evt.Content.Raw, evt.Sender, evt.RoomID)
}
}
diff --git a/matrix/sync.go b/matrix/sync.go
index 06c7f47..fc426bc 100644
--- a/matrix/sync.go
+++ b/matrix/sync.go
@@ -23,8 +23,8 @@ import (
"maunium.net/go/gomuks/debug"
"time"
- "maunium.net/go/mautrix"
"maunium.net/go/gomuks/matrix/rooms"
+ "maunium.net/go/mautrix"
)
type SyncerSession interface {
@@ -167,7 +167,14 @@ func (s *GomuksSyncer) GetFilterJSON(userID string) json.RawMessage {
},
},
Timeline: mautrix.FilterPart{
- Types: []string{"m.room.message", "m.room.member"},
+ Types: []string{
+ "m.room.message",
+ "m.room.member",
+ "m.room.name",
+ "m.room.topic",
+ "m.room.canonical_alias",
+ "m.room.aliases",
+ },
Limit: 50,
},
Ephemeral: mautrix.FilterPart{