From fb972576f3a6a52064553d1b9f39cd949a68f4f3 Mon Sep 17 00:00:00 2001 From: Rajeh Taher Date: Sat, 12 Oct 2024 02:30:04 +0300 Subject: [PATCH] startchat,twittermeow, go.mod: linting --- go.mod | 2 +- pkg/connector/startchat.go | 4 ++-- pkg/twittermeow/messaging.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 8270229..a6aaa24 100644 --- a/go.mod +++ b/go.mod @@ -11,6 +11,7 @@ require ( github.com/rs/zerolog v1.33.0 go.mau.fi/util v0.8.0 golang.org/x/net v0.29.0 + gopkg.in/yaml.v3 v3.0.1 maunium.net/go/mautrix v0.21.0 ) @@ -37,6 +38,5 @@ require ( golang.org/x/sys v0.25.0 // indirect golang.org/x/text v0.18.0 // indirect gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect maunium.net/go/mauflag v1.0.0 // indirect ) diff --git a/pkg/connector/startchat.go b/pkg/connector/startchat.go index 0f68271..fe79969 100644 --- a/pkg/connector/startchat.go +++ b/pkg/connector/startchat.go @@ -47,7 +47,7 @@ func (tc *TwitterClient) ResolveIdentifier(ctx context.Context, identifier strin perms := permissions.Permissions.GetPermissionsForUser(resolvedUser.IDStr) - if perms.CanDm == false || perms.ErrorCode > 0 { + if !perms.CanDm || perms.ErrorCode > 0 { return nil, fmt.Errorf("not allowed to DM this Twitter user: %v", resolvedUser.IDStr) } @@ -57,7 +57,7 @@ func (tc *TwitterClient) ResolveIdentifier(ctx context.Context, identifier strin return &bridgev2.ResolveIdentifierResponse{ Ghost: ghost, - UserID: networkid.UserID(resolvedUser.ID), + UserID: networkid.UserID(resolvedUser.IDStr), Chat: &bridgev2.CreateChatResponse{PortalKey: portalKey}, }, nil } diff --git a/pkg/twittermeow/messaging.go b/pkg/twittermeow/messaging.go index 1bc59f5..b6bdb26 100644 --- a/pkg/twittermeow/messaging.go +++ b/pkg/twittermeow/messaging.go @@ -178,7 +178,7 @@ func (c *Client) EditDirectMessage(payload *payload.EditDirectMessagePayload) (* } data := types.Message{} - return &data, json.Unmarshal(respBody, data) + return &data, json.Unmarshal(respBody, &data) } // keep in mind this only deletes the message for you