create_outbound method
Implementation
void create_outbound(
Account account, String identity_key, String one_time_key) {
final identity_key_units = utf8.encode(identity_key);
final one_time_key_units = utf8.encode(one_time_key);
final randomLen = olm_create_outbound_session_random_length(_inst);
final mem = malloc.call<Uint8>(
identity_key_units.length + one_time_key_units.length + randomLen);
final otMem = mem.elementAt(identity_key_units.length);
final rndMem = otMem.elementAt(one_time_key_units.length);
try {
mem.asTypedList(identity_key_units.length).setAll(0, identity_key_units);
otMem
.asTypedList(one_time_key_units.length)
.setAll(0, one_time_key_units);
_fillRandom(rndMem.asTypedList(randomLen));
olm_create_outbound_session(
_inst,
account._inst,
mem,
identity_key_units.length,
otMem,
one_time_key_units.length,
rndMem,
randomLen);
} finally {
malloc.free(mem);
}
}