diff --git a/commands.go b/commands.go index 7d72d0e..b08d34c 100644 --- a/commands.go +++ b/commands.go @@ -874,7 +874,7 @@ func (handler *CommandHandler) CommandOpen(ce *CommandEvent) { ce.Reply("Group JID not found in contacts. Try syncing contacts with `sync` first.") return } - handler.log.Debugln("Importing", jid, "for", user) + handler.log.Debugln("Importing", jid, "for", user.MXID) portal := user.bridge.GetPortalByJID(database.GroupPortalKey(jid)) if len(portal.MXID) > 0 { portal.Sync(user, contact) diff --git a/database/statestore.go b/database/statestore.go index 0d807d1..dd73fe4 100644 --- a/database/statestore.go +++ b/database/statestore.go @@ -198,7 +198,6 @@ func (store *SQLStateStore) SetMembership(roomID id.RoomID, userID id.UserID, me Membership: string(membership), } print("weird thing 2 502650285") - print(user.Membership) ans := store.db.Clauses(clause.OnConflict{ Columns: []clause.Column{{Name: "room_id"}, {Name: "user_id"}}, diff --git a/go.mod b/go.mod index 0b8db30..91adf9b 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,6 @@ require ( github.com/gorilla/websocket v1.4.2 github.com/jackc/pgproto3/v2 v2.0.7 // indirect github.com/karmanyaahm/groupme v0.2.0 - github.com/karmanyaahm/wray v0.0.0-20210129044305-8ca7d2cc2388 // indirect github.com/lib/pq v1.9.0 github.com/mattn/go-sqlite3 v1.14.6 github.com/prometheus/client_golang v1.9.0 @@ -29,3 +28,5 @@ require ( ) replace github.com/karmanyaahm/groupme => ../groupme + +replace github.com/karmanyaahm/wray => ../wray diff --git a/groupmeExt/client.go b/groupmeExt/client.go index ca6a8f2..527493e 100644 --- a/groupmeExt/client.go +++ b/groupmeExt/client.go @@ -2,7 +2,6 @@ package groupmeExt import ( "context" - "fmt" "github.com/karmanyaahm/groupme" "github.com/karmanyaahm/matrix-groupme-go/types" @@ -45,7 +44,7 @@ func (c Client) LoadMessagesBefore(groupID, lastMessageID string, num int) ([]*g BeforeID: groupme.ID(lastMessageID), Limit: num, }) - fmt.Println(groupID, lastMessageID, num, i.Count, e) + //fmt.Println(groupID, lastMessageID, num, i.Count, e) if e != nil { return nil, e } diff --git a/portal.go b/portal.go index e8cc36c..26c175e 100644 --- a/portal.go +++ b/portal.go @@ -587,6 +587,11 @@ func (portal *Portal) Sync(user *User, group groupme.Group) { portal.hasRelaybot = &yes } + err := user.Conn.SubscribeToGroup(context.TODO(), group.ID, user.Token) + if err != nil { + portal.log.Errorln("Subscribing failed, live metadata updates won't work", err) + } + if len(portal.MXID) == 0 { if !portal.IsPrivateChat() { portal.Name = group.Name