Skip to content

Commit

Permalink
startchat,twittermeow, go.mod: linting
Browse files Browse the repository at this point in the history
  • Loading branch information
PurpShell committed Oct 11, 2024
1 parent 0b610fe commit fb97257
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

Expand All @@ -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
)
4 changes: 2 additions & 2 deletions pkg/connector/startchat.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand All @@ -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
}
2 changes: 1 addition & 1 deletion pkg/twittermeow/messaging.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fb97257

Please sign in to comment.