Commit 93926e90 authored by manuroe's avatar manuroe
Browse files

OLMKit: Fixed warnings in objc wrapper

parent 29de7825
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
return self; return self;
} }
- (size_t) maxOneTimeKeys { - (NSUInteger) maxOneTimeKeys {
return olm_account_max_number_of_one_time_keys(_account); return olm_account_max_number_of_one_time_keys(_account);
} }
...@@ -156,7 +156,7 @@ ...@@ -156,7 +156,7 @@
- (BOOL) removeOneTimeKeysForSession:(OLMSession *)session { - (BOOL) removeOneTimeKeysForSession:(OLMSession *)session {
NSParameterAssert(session != nil); NSParameterAssert(session != nil);
if (!session) { if (!session) {
return nil; return NO;
} }
size_t result = olm_remove_one_time_keys(self.account, session.session); size_t result = olm_remove_one_time_keys(self.account, session.session);
if (result == olm_error()) { if (result == olm_error()) {
......
...@@ -167,9 +167,9 @@ ...@@ -167,9 +167,9 @@
} }
- (BOOL)matchesInboundSession:(NSString *)oneTimeKeyMessage { - (BOOL)matchesInboundSession:(NSString *)oneTimeKeyMessage {
NSData *otk = [oneTimeKeyMessage dataUsingEncoding:NSUTF8StringEncoding]; NSMutableData *otk = [NSMutableData dataWithData:[oneTimeKeyMessage dataUsingEncoding:NSUTF8StringEncoding]];
size_t result = olm_matches_inbound_session(_session, otk.bytes, otk.length); size_t result = olm_matches_inbound_session(_session, otk.mutableBytes, otk.length);
if (result == 1) { if (result == 1) {
return YES; return YES;
} }
...@@ -184,11 +184,11 @@ ...@@ -184,11 +184,11 @@
- (BOOL)matchesInboundSessionFrom:(NSString *)theirIdentityKey oneTimeKeyMessage:(NSString *)oneTimeKeyMessage { - (BOOL)matchesInboundSessionFrom:(NSString *)theirIdentityKey oneTimeKeyMessage:(NSString *)oneTimeKeyMessage {
NSData *idKey = [theirIdentityKey dataUsingEncoding:NSUTF8StringEncoding]; NSData *idKey = [theirIdentityKey dataUsingEncoding:NSUTF8StringEncoding];
NSData *otk = [oneTimeKeyMessage dataUsingEncoding:NSUTF8StringEncoding]; NSMutableData *otk = [NSMutableData dataWithData:[oneTimeKeyMessage dataUsingEncoding:NSUTF8StringEncoding]];
size_t result = olm_matches_inbound_session_from(_session, size_t result = olm_matches_inbound_session_from(_session,
idKey.bytes, idKey.length, idKey.bytes, idKey.length,
otk.bytes, otk.length); otk.mutableBytes, otk.length);
if (result == 1) { if (result == 1) {
return YES; return YES;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment