Beispiel #1
0
        /// <summary>
        /// Register an identity key, signed prekey, and list of one time prekeys
        /// with the server.
        /// </summary>
        /// <param name="identityKey">The client's long-term identity keypair.</param>
        /// <param name="signedPreKey">The client's signed prekey.</param>
        /// <param name="oneTimePreKeys">The client's list of one-time prekeys.</param>
        /// <param name="token">The cancellation token</param>
        /// <returns></returns>
        /// <exception cref="IOException"></exception>
        public async Task <bool> SetPreKeysAsync(IdentityKey identityKey, SignedPreKeyRecord signedPreKey, IList <PreKeyRecord> oneTimePreKeys, CancellationToken?token = null)
        {
            if (token == null)
            {
                token = CancellationToken.None;
            }

            await pushServiceSocket.RegisterPreKeysAsync(identityKey, signedPreKey, oneTimePreKeys, token);

            return(true);
        }