aboutsummaryrefslogtreecommitdiff
path: root/javascript
diff options
context:
space:
mode:
authorMark Haines <mjark@negativecurvature.net>2016-09-13 17:54:07 +0100
committerGitHub <noreply@github.com>2016-09-13 17:54:07 +0100
commit1a50a4b3a0bd38326a7f2327df5513072763ba65 (patch)
treefdb86b76d1a1e4a0c92dc2875dd463aac3e75310 /javascript
parente0b51971b7bc4cf3bb56b080f5f54296b58b3f0c (diff)
parent71bcaa5d45f63fc9b217937010199030d410f305 (diff)
Merge pull request #22 from matrix-org/markjh/inbound_group_session_id
Add a olm_inbound_group_session_id method
Diffstat (limited to 'javascript')
-rw-r--r--javascript/olm_inbound_group_session.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/javascript/olm_inbound_group_session.js b/javascript/olm_inbound_group_session.js
index 9722c31..01bfd26 100644
--- a/javascript/olm_inbound_group_session.js
+++ b/javascript/olm_inbound_group_session.js
@@ -89,4 +89,15 @@ InboundGroupSession.prototype['decrypt'] = restore_stack(function(
return Pointer_stringify(plaintext_buffer);
});
+InboundGroupSession.prototype['session_id'] = restore_stack(function() {
+ var length = inbound_group_session_method(
+ Module['_olm_inbound_group_session_id_length']
+ )(this.ptr);
+ var session_id = stack(length + NULL_BYTE_PADDING_LENGTH);
+ inbound_group_session_method(Module['_olm_inbound_group_session_id'])(
+ this.ptr, session_id, length
+ );
+ return Pointer_stringify(session_id);
+});
+
olm_exports['InboundGroupSession'] = InboundGroupSession;