aboutsummaryrefslogtreecommitdiff
path: root/javascript/olm_inbound_group_session.js
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2017-01-06 17:40:39 +0000
committerRichard van der Hoff <richard@matrix.org>2017-01-09 17:45:46 +0000
commita2f0c93a93f6914291954b08a7518b4f17561c11 (patch)
treefc75bc7e84808868bc4b9eb3844115bab277ada2 /javascript/olm_inbound_group_session.js
parent5fbeb3e29b6440a799d9320e871a1d4d509130b8 (diff)
Implement importing group session data
olm_import_inbound_group_session, which reads the format written by olm_export_inbound_group_session to initialise a group session.
Diffstat (limited to 'javascript/olm_inbound_group_session.js')
-rw-r--r--javascript/olm_inbound_group_session.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/javascript/olm_inbound_group_session.js b/javascript/olm_inbound_group_session.js
index 8721a10..6bc745d 100644
--- a/javascript/olm_inbound_group_session.js
+++ b/javascript/olm_inbound_group_session.js
@@ -61,6 +61,15 @@ InboundGroupSession.prototype['create'] = restore_stack(function(session_key) {
);
});
+InboundGroupSession.prototype['import_session'] = restore_stack(function(session_key) {
+ var key_array = array_from_string(session_key);
+ var key_buffer = stack(key_array);
+
+ inbound_group_session_method(Module['_olm_import_inbound_group_session'])(
+ this.ptr, key_buffer, key_array.length
+ );
+});
+
InboundGroupSession.prototype['decrypt'] = restore_stack(function(
message
) {