whisper: updated parametr names and comments

This commit is contained in:
Vlad 2017-04-22 11:08:40 +02:00
parent 231082d8b8
commit 4abacbbb92

View file

@ -269,9 +269,10 @@ func (api *PublicWhisperAPI) Unsubscribe(id string) {
api.whisper.Unsubscribe(id) api.whisper.Unsubscribe(id)
} }
// GetSubscriptionMessages retrieves all the new messages matched by a filter since the last retrieval. // GetSubscriptionMessages retrieves all the new messages matched by the corresponding
func (api *PublicWhisperAPI) GetSubscriptionMessages(filterId string) []*WhisperMessage { // subscription filter since the last retrieval.
f := api.whisper.GetFilter(filterId) func (api *PublicWhisperAPI) GetSubscriptionMessages(id string) []*WhisperMessage {
f := api.whisper.GetFilter(id)
if f != nil { if f != nil {
newMail := f.Retrieve() newMail := f.Retrieve()
return toWhisperMessages(newMail) return toWhisperMessages(newMail)
@ -279,10 +280,10 @@ func (api *PublicWhisperAPI) GetSubscriptionMessages(filterId string) []*Whisper
return toWhisperMessages(nil) return toWhisperMessages(nil)
} }
// GetMessages retrieves all the floating messages that match a specific filter. // GetMessages retrieves all the floating messages that match a specific subscription filter.
// It is likely to be called once per session, right after Subscribe call. // It is likely to be called once per session, right after Subscribe call.
func (api *PublicWhisperAPI) GetMessages(filterId string) []*WhisperMessage { func (api *PublicWhisperAPI) GetMessages(id string) []*WhisperMessage {
all := api.whisper.Messages(filterId) all := api.whisper.Messages(id)
return toWhisperMessages(all) return toWhisperMessages(all)
} }
@ -383,7 +384,7 @@ type PostArgs struct {
Type string `json:"type"` // "sym"/"asym" (symmetric or asymmetric) Type string `json:"type"` // "sym"/"asym" (symmetric or asymmetric)
TTL uint32 `json:"ttl"` // time-to-live in seconds TTL uint32 `json:"ttl"` // time-to-live in seconds
SignWith string `json:"signWith"` // id of the signing key SignWith string `json:"signWith"` // id of the signing key
Key string `json:"key"` // id of encryption key Key string `json:"key"` // key id (in case of sym) or public key (in case of asym)
Topic hexutil.Bytes `json:"topic"` // topic (4 bytes) Topic hexutil.Bytes `json:"topic"` // topic (4 bytes)
Padding hexutil.Bytes `json:"padding"` // optional padding bytes Padding hexutil.Bytes `json:"padding"` // optional padding bytes
Payload hexutil.Bytes `json:"payload"` // payload to be encrypted Payload hexutil.Bytes `json:"payload"` // payload to be encrypted