aboutsummaryrefslogtreecommitdiff
path: root/javascript
diff options
context:
space:
mode:
Diffstat (limited to 'javascript')
-rw-r--r--javascript/demo.html3
-rw-r--r--javascript/olm_post.js22
2 files changed, 25 insertions, 0 deletions
diff --git a/javascript/demo.html b/javascript/demo.html
index c9cad8b..2120f95 100644
--- a/javascript/demo.html
+++ b/javascript/demo.html
@@ -28,6 +28,9 @@ document.addEventListener("DOMContentLoaded", function (event) {
tasks.push(["alice", "Creating account", function() { alice.create() }]);
tasks.push(["bob", "Creating account", function() { bob.create() }]);
+ tasks.push(["bob", "Generate one time keys", function() {
+ bob.generate_one_time_keys(1);
+ }]);
tasks.push(["alice", "Create outbound session", function() {
var bobs_id_keys = JSON.parse(bob.identity_keys("bob", "bob_device", 0, 0));
var bobs_id_key;
diff --git a/javascript/olm_post.js b/javascript/olm_post.js
index 7bcc580..aa28f86 100644
--- a/javascript/olm_post.js
+++ b/javascript/olm_post.js
@@ -100,6 +100,28 @@ Account.prototype['one_time_keys'] = restore_stack(function() {
return Pointer_stringify(keys, keys_length);
});
+Account.prototype['mark_keys_as_published'] = restore_stack(function() {
+ account_method(Module['_olm_account_mark_keys_as_published'])(this.ptr);
+});
+
+Account.prototype['max_number_of_one_time_keys'] = restore_stack(function() {
+ account_method(Module['_olm_account_max_number_of_one_time_keys'])(
+ this.ptr
+ );
+});
+
+Account.prototype['generate_one_time_keys'] = restore_stack(function(
+ number_of_keys
+) {
+ var random_length = account_method(
+ Module['_olm_account_generate_one_time_keys_random_length']
+ )(this.ptr, number_of_keys);
+ var random = random_stack(random_length);
+ account_method(Module['_olm_account_generate_one_time_keys'])(
+ this.ptr, number_of_keys, random, random_length
+ );
+});
+
Account.prototype['pickle'] = restore_stack(function(key) {
var key_array = array_from_string(key);
var pickle_length = account_method(