OlmSession.has_received_message
I find myself wanting to know if an OlmSession is in the pre-key state or not, to help debugging at the application level.
This commit is contained in:
parent
0c3f527dfd
commit
2e9021c2e7
3 changed files with 17 additions and 0 deletions
|
@ -300,6 +300,10 @@ size_t olm_session_id(
|
||||||
void * id, size_t id_length
|
void * id, size_t id_length
|
||||||
);
|
);
|
||||||
|
|
||||||
|
int olm_session_has_received_message(
|
||||||
|
OlmSession *session
|
||||||
|
);
|
||||||
|
|
||||||
/** Checks if the PRE_KEY message is for this in-bound session. This can happen
|
/** Checks if the PRE_KEY message is for this in-bound session. This can happen
|
||||||
* if multiple messages are sent to this account before this account sends a
|
* if multiple messages are sent to this account before this account sends a
|
||||||
* message in reply. Returns olm_error() on failure. If the base64
|
* message in reply. Returns olm_error() on failure. If the base64
|
||||||
|
|
|
@ -263,6 +263,13 @@ Session.prototype['session_id'] = restore_stack(function() {
|
||||||
return Pointer_stringify(id_buffer);
|
return Pointer_stringify(id_buffer);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Session.prototype['has_received_message'] = function() {
|
||||||
|
return session_method(Module['_olm_session_has_received_message'])(
|
||||||
|
this.ptr
|
||||||
|
) ? true : false;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
Session.prototype['matches_inbound'] = restore_stack(function(
|
Session.prototype['matches_inbound'] = restore_stack(function(
|
||||||
one_time_key_message
|
one_time_key_message
|
||||||
) {
|
) {
|
||||||
|
|
|
@ -529,6 +529,12 @@ size_t olm_session_id(
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int olm_session_has_received_message(
|
||||||
|
OlmSession * session
|
||||||
|
) {
|
||||||
|
return from_c(session)->received_message;
|
||||||
|
}
|
||||||
|
|
||||||
size_t olm_matches_inbound_session(
|
size_t olm_matches_inbound_session(
|
||||||
OlmSession * session,
|
OlmSession * session,
|
||||||
void * one_time_key_message, size_t message_length
|
void * one_time_key_message, size_t message_length
|
||||||
|
|
Loading…
Reference in a new issue