diff --git a/formatting.go b/formatting.go index 03b21d1..4fed513 100644 --- a/formatting.go +++ b/formatting.go @@ -51,13 +51,13 @@ func NewFormatter(bridge *Bridge) *Formatter { TabsToSpaces: 4, Newline: "\n", - PillConverter: func(mxid, eventID string, ctx format.Context) string { + PillConverter: func(displayname, mxid, eventID string, ctx format.Context) string { if mxid[0] == '@' { puppet := bridge.GetPuppetByMXID(id.UserID(mxid)) if puppet != nil { - jids, ok := ctx[mentionedJIDsContextKey].([]types.GroupMeID) + jids, ok := ctx[mentionedJIDsContextKey].([]whatsapp.JID) if !ok { - ctx[mentionedJIDsContextKey] = []types.GroupMeID{puppet.JID} + ctx[mentionedJIDsContextKey] = []whatsapp.JID{puppet.JID} } else { ctx[mentionedJIDsContextKey] = append(jids, puppet.JID) } @@ -97,7 +97,8 @@ func NewFormatter(bridge *Bridge) *Formatter { return fmt.Sprintf("%s", str) }, } - formatter.waReplFuncText = map[*regexp.Regexp]func(string) string{} + formatter.waReplFuncText = map[*regexp.Regexp]func(string) string{ + } return formatter } diff --git a/portal.go b/portal.go index 126d72d..4aa3ce4 100644 --- a/portal.go +++ b/portal.go @@ -1984,7 +1984,7 @@ func (portal *Portal) convertGifToVideo(gif []byte) ([]byte, error) { "-pix_fmt", "yuv420p", "-c:v", "libx264", "-movflags", "+faststart", "-filter:v", "crop='floor(in_w/2)*2:floor(in_h/2)*2'", outputFileName) - vcLog := portal.log.Sub("VideoConverter").WithDefaultLevel(log.LevelWarn) + vcLog := portal.log.Sub("VideoConverter").Writer(log.LevelWarn) cmd.Stdout = vcLog cmd.Stderr = vcLog diff --git a/user.go b/user.go index cf4c78c..0e589a7 100644 --- a/user.go +++ b/user.go @@ -695,9 +695,15 @@ func (user *User) UpdateDirectChats(chats map[id.UserID][]id.RoomID) { var err error if user.bridge.Config.Homeserver.Asmux { urlPath := intent.BuildBaseURL("_matrix", "client", "unstable", "net.maunium.asmux", "dms") - _, err = intent.MakeFullRequest(method, urlPath, http.Header{ - "X-Asmux-Auth": {user.bridge.AS.Registration.AppToken}, - }, chats, nil) + // _, err = intent.MakeFullRequest(method, urlPath, http.Header{ + // "X-Asmux-Auth": {user.bridge.AS.Registration.AppToken}, + // }, chats, nil) + _, err = intent.MakeFullRequest(mautrix.FullRequest{ + Method: method, + URL: urlPath, + Headers: http.Header{"X-Asmux-Auth": {user.bridge.AS.Registration.AppToken}}, + RequestJSON: chats, + }) } else { existingChats := make(map[id.UserID][]id.RoomID) err = intent.GetAccountData(event.AccountDataDirectChats.Type, &existingChats)