Skip to content

Commit

Permalink
staticcheck: remove unused variables and functions
Browse files Browse the repository at this point in the history
Signed-off-by: Sumner Evans <me@sumnerevans.com>
  • Loading branch information
sumnerevans committed Jan 8, 2024
1 parent c456d6e commit 6892b7a
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 27 deletions.
17 changes: 0 additions & 17 deletions pkg/signalmeow/profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"context"
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"encoding/base64"
"encoding/hex"
"encoding/json"
Expand Down Expand Up @@ -300,22 +299,6 @@ func decryptString(key *libsignalgo.ProfileKey, encryptedText []byte) (string, e
return string(data), err
}

func encryptString(key libsignalgo.ProfileKey, plaintext string, paddedLength int) ([]byte, error) {
inputLength := len(plaintext)
if inputLength > paddedLength {
return nil, errors.New("plaintext longer than paddedLength")
}
padded := append([]byte(plaintext), make([]byte, paddedLength-inputLength)...)
nonce := make([]byte, NONCE_LENGTH)
rand.Read(nonce)
keyBytes := key[:]
ciphertext, err := AesgcmEncrypt(keyBytes, nonce, padded)
if err != nil {
return nil, err
}
return append(nonce, ciphertext...), nil
}

const NONCE_LENGTH = 12
const TAG_LENGTH_BYTES = 16

Expand Down
5 changes: 0 additions & 5 deletions pkg/signalmeow/sending.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,11 +303,6 @@ type GroupMessageSendResult struct {
FailedToSendTo []FailedSendResult
}

func contentFromDataMessage(dataMessage *signalpb.DataMessage) *signalpb.Content {
return &signalpb.Content{
DataMessage: dataMessage,
}
}
func syncMessageFromGroupDataMessage(dataMessage *signalpb.DataMessage, results []SuccessfulSendResult) *signalpb.Content {
unidentifiedStatuses := []*signalpb.SyncMessage_Sent_UnidentifiedDeliveryStatus{}
for _, result := range results {
Expand Down
3 changes: 0 additions & 3 deletions puppet.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (
"fmt"
"net/http"
"regexp"
"sync"

"github.com/google/uuid"
"github.com/rs/zerolog"
Expand Down Expand Up @@ -191,8 +190,6 @@ type Puppet struct {

customIntent *appservice.IntentAPI
customUser *User

syncLock sync.Mutex
}

var userIDRegex *regexp.Regexp
Expand Down
3 changes: 1 addition & 2 deletions user.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,7 @@ type User struct {

Client *signalmeow.Client

BridgeState *bridge.BridgeStateQueue
bridgeStateLock sync.Mutex
BridgeState *bridge.BridgeStateQueue

spaceMembershipChecked bool
spaceCreateLock sync.Mutex
Expand Down

0 comments on commit 6892b7a

Please sign in to comment.