Add SignMessageWithChatKey
This commit is contained in:
parent
ab01a05cd6
commit
2d0818d873
|
@ -3068,6 +3068,11 @@ func (m *Messenger) pullMessagesAndResponsesFromDB(messages []*Message) ([]*Mess
|
||||||
return m.persistence.MessagesByIDs(messageIDs)
|
return m.persistence.MessagesByIDs(messageIDs)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *Messenger) SignMessage(message string) ([]byte, error) {
|
||||||
|
hash := crypto.TextHash([]byte(message))
|
||||||
|
return crypto.Sign(hash, m.identity)
|
||||||
|
}
|
||||||
|
|
||||||
func (m *Messenger) getTimesource() TimeSource {
|
func (m *Messenger) getTimesource() TimeSource {
|
||||||
return m.transport
|
return m.transport
|
||||||
}
|
}
|
||||||
|
|
|
@ -392,6 +392,10 @@ func (api *PublicAPI) SyncDevices(ctx context.Context, name, picture string) err
|
||||||
return api.service.messenger.SyncDevices(ctx, name, picture)
|
return api.service.messenger.SyncDevices(ctx, name, picture)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (api *PublicAPI) SignMessageWithChatKey(ctx context.Context, message string) (types.HexBytes, error) {
|
||||||
|
return api.service.messenger.SignMessage(message)
|
||||||
|
}
|
||||||
|
|
||||||
func (api *PublicAPI) UpdateMailservers(enodes []string) error {
|
func (api *PublicAPI) UpdateMailservers(enodes []string) error {
|
||||||
nodes := make([]*enode.Node, len(enodes))
|
nodes := make([]*enode.Node, len(enodes))
|
||||||
for i, rawurl := range enodes {
|
for i, rawurl := range enodes {
|
||||||
|
|
Loading…
Reference in New Issue