Use length variable, Comment deprecation of GetOnion
This commit is contained in:
parent
ead6a2698f
commit
c62ecd6f71
|
@ -143,10 +143,10 @@ func (g *Group) GetMessage(index int) (bool, Message, int) {
|
||||||
|
|
||||||
length := len(g.Timeline.Messages)
|
length := len(g.Timeline.Messages)
|
||||||
|
|
||||||
if len(g.Timeline.Messages) > index {
|
if length > index {
|
||||||
return true, g.Timeline.Messages[index], length
|
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
|
// AddMessage takes a DecryptedGroupMessage and adds it to the Groups Timeline
|
||||||
|
|
|
@ -249,6 +249,9 @@ type CwtchPeer interface {
|
||||||
StartServerConnections()
|
StartServerConnections()
|
||||||
Shutdown()
|
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
|
// Deprecated
|
||||||
GetOnion() string
|
GetOnion() string
|
||||||
|
|
||||||
|
|
|
@ -108,7 +108,7 @@ func TestProfileStoreChangePassword(t *testing.T) {
|
||||||
event.TimestampReceived: time.Now().Format(time.RFC3339Nano),
|
event.TimestampReceived: time.Now().Format(time.RFC3339Nano),
|
||||||
event.RemotePeer: profile.Onion,
|
event.RemotePeer: profile.Onion,
|
||||||
event.Data: testMessage,
|
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.TimestampReceived: time.Now().Format(time.RFC3339Nano),
|
||||||
event.RemotePeer: profile.Onion,
|
event.RemotePeer: profile.Onion,
|
||||||
event.Data: testMessage,
|
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)
|
time.Sleep(3 * time.Second)
|
||||||
|
|
Loading…
Reference in New Issue