Browse Source

Use length variable, Comment deprecation of GetOnion

group_refactor
Sarah Jamie Lewis 1 month ago
parent
commit
c62ecd6f71
  1. 4
      model/group.go
  2. 3
      peer/cwtch_peer.go
  3. 4
      storage/v1/profile_store_test.go

4
model/group.go

@ -143,10 +143,10 @@ func (g *Group) GetMessage(index int) (bool, Message, int) {
length := len(g.Timeline.Messages)
if len(g.Timeline.Messages) > index {
if length > index {
return true, g.Timeline.Messages[index], length
}
return false, Message{}, len(g.Timeline.Messages)
return false, Message{}, length
}
// AddMessage takes a DecryptedGroupMessage and adds it to the Groups Timeline

3
peer/cwtch_peer.go

@ -249,6 +249,9 @@ type CwtchPeer interface {
StartServerConnections()
Shutdown()
// GetOnion is deprecated. If you find yourself needing to rely on this method it is time
// to consider replacing this with a GetAddress(es) function that can fully expand cwtch beyond the boundaries
// of tor v3 onion services.
// Deprecated
GetOnion() string

4
storage/v1/profile_store_test.go

@ -108,7 +108,7 @@ func TestProfileStoreChangePassword(t *testing.T) {
event.TimestampReceived: time.Now().Format(time.RFC3339Nano),
event.RemotePeer: profile.Onion,
event.Data: testMessage,
event.Signature: base64.StdEncoding.EncodeToString([]byte{byte(i)}),
event.Signature: base64.StdEncoding.EncodeToString([]byte{byte(i)}),
}))
}
@ -131,7 +131,7 @@ func TestProfileStoreChangePassword(t *testing.T) {
event.TimestampReceived: time.Now().Format(time.RFC3339Nano),
event.RemotePeer: profile.Onion,
event.Data: testMessage,
event.Signature: base64.StdEncoding.EncodeToString([]byte{0x01, byte(i)}),
event.Signature: base64.StdEncoding.EncodeToString([]byte{0x01, byte(i)}),
}))
}
time.Sleep(3 * time.Second)

Loading…
Cancel
Save