aboutsummaryrefslogtreecommitdiff
path: root/python
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 /python
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 'python')
-rw-r--r--python/olm/inbound_group_session.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/python/olm/inbound_group_session.py b/python/olm/inbound_group_session.py
index 6c01095..310620f 100644
--- a/python/olm/inbound_group_session.py
+++ b/python/olm/inbound_group_session.py
@@ -45,6 +45,9 @@ inbound_group_session_function(
c_void_p, c_size_t, # plaintext
)
+inbound_group_session_function(lib.olm_inbound_group_session_id_length)
+inbound_group_session_function(lib.olm_inbound_group_session_id, c_void_p, c_size_t)
+
class InboundGroupSession(object):
def __init__(self):
self.buf = create_string_buffer(lib.olm_inbound_group_session_size())
@@ -84,3 +87,9 @@ class InboundGroupSession(object):
plaintext_buffer, max_plaintext_length
)
return plaintext_buffer.raw[:plaintext_length]
+
+ def session_id(self):
+ id_length = lib.olm_inbound_group_session_id_length(self.ptr)
+ id_buffer = create_string_buffer(id_length)
+ lib.olm_inbound_group_session_id(self.ptr, id_buffer, id_length);
+ return id_buffer.raw