v1.5.1 Release

This commit is contained in:
2024-02-28 23:57:01 +02:00
parent bec08b56be
commit 42f9650515
10 changed files with 136 additions and 63 deletions

View File

@ -12,7 +12,7 @@
#import "OCTSendMessageOperation.h"
#import "OCTTox+Private.h"
#import "OCTToxOptions+Private.h"
#import "Firebase.h"
//#import "Firebase.h"
@interface OCTSubmanagerChatsImpl ()
@ -71,18 +71,6 @@
- (void)sendOwnPush
{
NSLog(@"PUSH:sendOwnPush");
NSString *token = [FIRMessaging messaging].FCMToken;
if (token.length > 0)
{
NSString *my_pushToken = [NSString stringWithFormat:@"https://tox.zoff.xyz/toxfcm/fcm.php?id=%@&type=1", token];
// NSLog(@"token push url=%@", my_pushToken);
triggerPush(my_pushToken, nil, nil, nil);
}
else
{
NSLog(@"PUSH:sendOwnPush:no token");
}
}
- (void)sendMessagePushToChat:(OCTChat *)chat
@ -499,13 +487,6 @@ triggerPush(NSString *used_pushToken,
NSString *publicKey = [[self.dataSource managerGetTox] publicKeyFromFriendNumber:friendNumber error:nil];
OCTFriend *friend = [realmManager friendWithPublicKey:publicKey];
if (friend.msgv3Capability == YES)
{
// HINT: if friend has msgV3 capability, we ignore the low level ACK and keep waiting for the high level ACK
OCTLogInfo(@"messageDelivered ignoring low level ACK %@", friend);
return;
}
OCTChat *chat = [realmManager getOrCreateChatWithFriend:friend];
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"chatUniqueIdentifier == %@ AND messageText.messageId == %d",

View File

@ -8,7 +8,7 @@
#import "OCTFriend.h"
#import "OCTFriendRequest.h"
#import "OCTRealmManager.h"
#import "Firebase.h"
//#import "Firebase.h"
@implementation OCTSubmanagerFriendsImpl
@synthesize dataSource = _dataSource;
@ -232,12 +232,11 @@
NSString *publicKey = [[self.dataSource managerGetTox] publicKeyFromFriendNumber:friendNumber error:nil];
OCTFriend *friend = [realmManager friendWithPublicKey:publicKey];
if (friend.msgv3Capability != msgv3Capability)
{
[realmManager updateObject:friend withBlock:^(OCTFriend *theFriend) {
theFriend.msgv3Capability = msgv3Capability;
}];
}
//TODO(Tha_14): Remove this after removing msgv3 stuff
[realmManager updateObject:friend withBlock:^(OCTFriend *theFriend) {
theFriend.msgv3Capability = 0;
}];
}
- (void)tox:(OCTTox *)tox friendConnectionStatusChanged:(OCTToxConnectionStatus)status friendNumber:(OCTToxFriendNumber)friendNumber
@ -255,26 +254,11 @@
{
// Friend is coming online now
OCTToxCapabilities f_caps = [tox friendGetCapabilitiesWithFriendNumber:friendNumber];
OCTLogVerbose(@"f_caps=%lu", f_caps);
NSString* cap_string = [NSString stringWithFormat:@"%lu", f_caps];
theFriend.capabilities2 = cap_string;
// OCTToxCapabilities f_caps = [tox friendGetCapabilitiesWithFriendNumber:friendNumber];
// OCTLogVerbose(@"f_caps=%lu", f_caps);
// NSString* cap_string = [NSString stringWithFormat:@"%lu", f_caps];
// theFriend.capabilities2 = cap_string;
NSString *token = [FIRMessaging messaging].FCMToken;
if (token.length > 0)
{
// HINT: prepend a dummy "A" char as placeholder for Tox Packet ID.
// it will be replaced in sendLosslessPacketWithFriendNumber by pktid
NSString *data = [NSString stringWithFormat:@"Ahttps://tox.zoff.xyz/toxfcm/fcm.php?id=%@&type=1", token];
// NSLog(@"token push url=%@", data);
NSError *error;
// HINT: pktid 181 is for sending push urls to friends
BOOL result = [tox sendLosslessPacketWithFriendNumber:friendNumber
pktid:181
data:data
error:&error];
}
}
theFriend.isConnected = (status != OCTToxConnectionStatusNone);
theFriend.connectionStatus = status;