Skip to content

Commit 6892b7a

Browse files
committed
staticcheck: remove unused variables and functions
Signed-off-by: Sumner Evans <[email protected]>
1 parent c456d6e commit 6892b7a

File tree

4 files changed

+1
-27
lines changed

4 files changed

+1
-27
lines changed

pkg/signalmeow/profile.go

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import (
2020
"context"
2121
"crypto/aes"
2222
"crypto/cipher"
23-
"crypto/rand"
2423
"encoding/base64"
2524
"encoding/hex"
2625
"encoding/json"
@@ -300,22 +299,6 @@ func decryptString(key *libsignalgo.ProfileKey, encryptedText []byte) (string, e
300299
return string(data), err
301300
}
302301

303-
func encryptString(key libsignalgo.ProfileKey, plaintext string, paddedLength int) ([]byte, error) {
304-
inputLength := len(plaintext)
305-
if inputLength > paddedLength {
306-
return nil, errors.New("plaintext longer than paddedLength")
307-
}
308-
padded := append([]byte(plaintext), make([]byte, paddedLength-inputLength)...)
309-
nonce := make([]byte, NONCE_LENGTH)
310-
rand.Read(nonce)
311-
keyBytes := key[:]
312-
ciphertext, err := AesgcmEncrypt(keyBytes, nonce, padded)
313-
if err != nil {
314-
return nil, err
315-
}
316-
return append(nonce, ciphertext...), nil
317-
}
318-
319302
const NONCE_LENGTH = 12
320303
const TAG_LENGTH_BYTES = 16
321304

pkg/signalmeow/sending.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -303,11 +303,6 @@ type GroupMessageSendResult struct {
303303
FailedToSendTo []FailedSendResult
304304
}
305305

306-
func contentFromDataMessage(dataMessage *signalpb.DataMessage) *signalpb.Content {
307-
return &signalpb.Content{
308-
DataMessage: dataMessage,
309-
}
310-
}
311306
func syncMessageFromGroupDataMessage(dataMessage *signalpb.DataMessage, results []SuccessfulSendResult) *signalpb.Content {
312307
unidentifiedStatuses := []*signalpb.SyncMessage_Sent_UnidentifiedDeliveryStatus{}
313308
for _, result := range results {

puppet.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import (
2323
"fmt"
2424
"net/http"
2525
"regexp"
26-
"sync"
2726

2827
"github.com/google/uuid"
2928
"github.com/rs/zerolog"
@@ -191,8 +190,6 @@ type Puppet struct {
191190

192191
customIntent *appservice.IntentAPI
193192
customUser *User
194-
195-
syncLock sync.Mutex
196193
}
197194

198195
var userIDRegex *regexp.Regexp

user.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,7 @@ type User struct {
163163

164164
Client *signalmeow.Client
165165

166-
BridgeState *bridge.BridgeStateQueue
167-
bridgeStateLock sync.Mutex
166+
BridgeState *bridge.BridgeStateQueue
168167

169168
spaceMembershipChecked bool
170169
spaceCreateLock sync.Mutex

0 commit comments

Comments
 (0)