v1.5.1 Release

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

View File

@ -578,6 +578,7 @@
AFA023F4274C069100FBFCC0 /* ConnectionStatus.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFA023F3274C069100FBFCC0 /* ConnectionStatus.swift */; }; AFA023F4274C069100FBFCC0 /* ConnectionStatus.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFA023F3274C069100FBFCC0 /* ConnectionStatus.swift */; };
AFA024022753CC9000FBFCC0 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = AFA024012753CC9000FBFCC0 /* GoogleService-Info.plist */; }; AFA024022753CC9000FBFCC0 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = AFA024012753CC9000FBFCC0 /* GoogleService-Info.plist */; };
D4F896D05F7EAA7C321A2AA8 /* libPods-Antidote.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 034E57B3AE56E352BBAA0487 /* libPods-Antidote.a */; }; D4F896D05F7EAA7C321A2AA8 /* libPods-Antidote.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 034E57B3AE56E352BBAA0487 /* libPods-Antidote.a */; };
F1D850AB2B8FD3D8000CE8FB /* dark-theme.yaml in Resources */ = {isa = PBXBuildFile; fileRef = F1D850AA2B8FD3D8000CE8FB /* dark-theme.yaml */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */ /* Begin PBXContainerItemProxy section */
@ -983,6 +984,7 @@
AFA024012753CC9000FBFCC0 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; }; AFA024012753CC9000FBFCC0 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
B3C17AF8CE3B4AD1B68F2B5B /* Pods-Antidote.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Antidote.release.xcconfig"; path = "Pods/Target Support Files/Pods-Antidote/Pods-Antidote.release.xcconfig"; sourceTree = "<group>"; }; B3C17AF8CE3B4AD1B68F2B5B /* Pods-Antidote.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Antidote.release.xcconfig"; path = "Pods/Target Support Files/Pods-Antidote/Pods-Antidote.release.xcconfig"; sourceTree = "<group>"; };
CEC32120B965BE40E0029DB1 /* Pods-AntidoteTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AntidoteTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-AntidoteTests/Pods-AntidoteTests.release.xcconfig"; sourceTree = "<group>"; }; CEC32120B965BE40E0029DB1 /* Pods-AntidoteTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AntidoteTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-AntidoteTests/Pods-AntidoteTests.release.xcconfig"; sourceTree = "<group>"; };
F1D850AA2B8FD3D8000CE8FB /* dark-theme.yaml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.yaml; path = "dark-theme.yaml"; sourceTree = "<group>"; };
/* End PBXFileReference section */ /* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */ /* Begin PBXFrameworksBuildPhase section */
@ -1518,6 +1520,7 @@
9CEA6A1E1D957EFC0045F000 /* antidote-acknowledgements.html */, 9CEA6A1E1D957EFC0045F000 /* antidote-acknowledgements.html */,
1131D6C71CA9D8BC00B4531C /* import-profile.html */, 1131D6C71CA9D8BC00B4531C /* import-profile.html */,
1173F0711BC5D9DA00B88B7B /* default-theme.yaml */, 1173F0711BC5D9DA00B88B7B /* default-theme.yaml */,
F1D850AA2B8FD3D8000CE8FB /* dark-theme.yaml */,
9C7475C01BC698110098B1A4 /* Localizable.strings */, 9C7475C01BC698110098B1A4 /* Localizable.strings */,
113E96461E4BB302000282FC /* AppStoreLocalizable.strings */, 113E96461E4BB302000282FC /* AppStoreLocalizable.strings */,
116634CE1C70E46C0072C980 /* Launch Screen.storyboard */, 116634CE1C70E46C0072C980 /* Launch Screen.storyboard */,
@ -1793,6 +1796,7 @@
116634CF1C70E46C0072C980 /* Launch Screen.storyboard in Resources */, 116634CF1C70E46C0072C980 /* Launch Screen.storyboard in Resources */,
1131D6C51CA9D8BC00B4531C /* import-profile.html in Resources */, 1131D6C51CA9D8BC00B4531C /* import-profile.html in Resources */,
11B253521C4AD9CF0068F47C /* isotoxin_NewMessage.aac in Resources */, 11B253521C4AD9CF0068F47C /* isotoxin_NewMessage.aac in Resources */,
F1D850AB2B8FD3D8000CE8FB /* dark-theme.yaml in Resources */,
1164764519794D3300DB20B8 /* Images.xcassets in Resources */, 1164764519794D3300DB20B8 /* Images.xcassets in Resources */,
11B253511C4AD9CF0068F47C /* isotoxin_Hangup.aac in Resources */, 11B253511C4AD9CF0068F47C /* isotoxin_Hangup.aac in Resources */,
); );
@ -2771,6 +2775,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_IDENTITY = "iPhone Developer";
COPY_PHASE_STRIP = NO; COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 105001;
ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES; ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99; GCC_C_LANGUAGE_STANDARD = gnu99;
@ -2790,6 +2795,7 @@
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.0; IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MARKETING_VERSION = 1.5.1;
ONLY_ACTIVE_ARCH = YES; ONLY_ACTIVE_ARCH = YES;
PROVISIONING_PROFILE = ""; PROVISIONING_PROFILE = "";
SDKROOT = iphoneos; SDKROOT = iphoneos;
@ -2828,6 +2834,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_IDENTITY = "iPhone Developer";
COPY_PHASE_STRIP = YES; COPY_PHASE_STRIP = YES;
CURRENT_PROJECT_VERSION = 105001;
ENABLE_NS_ASSERTIONS = NO; ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99; GCC_C_LANGUAGE_STANDARD = gnu99;
@ -2840,6 +2847,7 @@
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.0; IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MARKETING_VERSION = 1.5.1;
SDKROOT = iphoneos; SDKROOT = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule; SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O"; SWIFT_OPTIMIZATION_LEVEL = "-O";
@ -2857,7 +2865,7 @@
CODE_SIGN_ENTITLEMENTS = Antidote/Antidote.entitlements; CODE_SIGN_ENTITLEMENTS = Antidote/Antidote.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CURRENT_PROJECT_VERSION = 105000; CURRENT_PROJECT_VERSION = "$(CURRENT_PROJECT_VERSION)";
DEVELOPMENT_TEAM = Y46L589C5C; DEVELOPMENT_TEAM = Y46L589C5C;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES;
@ -2869,7 +2877,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 1.5.0; MARKETING_VERSION = "$(MARKETING_VERSION)";
PRODUCT_BUNDLE_IDENTIFIER = "org.zoxcore.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_BUNDLE_IDENTIFIER = "org.zoxcore.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = ""; PROVISIONING_PROFILE = "";
@ -2893,7 +2901,7 @@
CODE_SIGN_ENTITLEMENTS = Antidote/Antidote.entitlements; CODE_SIGN_ENTITLEMENTS = Antidote/Antidote.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CURRENT_PROJECT_VERSION = 105000; CURRENT_PROJECT_VERSION = "$(CURRENT_PROJECT_VERSION)";
DEVELOPMENT_TEAM = Y46L589C5C; DEVELOPMENT_TEAM = Y46L589C5C;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES;
@ -2905,7 +2913,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 1.5.0; MARKETING_VERSION = "$(MARKETING_VERSION)";
PRODUCT_BUNDLE_IDENTIFIER = "org.zoxcore.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_BUNDLE_IDENTIFIER = "org.zoxcore.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = ""; PROVISIONING_PROFILE = "";

View File

@ -1,10 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Used to share your location with your contacts</string>
<key>CFBundleDevelopmentRegion</key> <key>CFBundleDevelopmentRegion</key>
<string>en</string> <string>en</string>
<key>CFBundleDisplayName</key> <key>CFBundleDisplayName</key>
@ -50,6 +47,10 @@
<false/> <false/>
<key>NSCameraUsageDescription</key> <key>NSCameraUsageDescription</key>
<string>You can use video calls, send photos and videos, scan QR codes.</string> <string>You can use video calls, send photos and videos, scan QR codes.</string>
<key>NSFaceIDUsageDescription</key>
<string>Used in order to unlock the app instead of using a PIN pattern.</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Used to share your location with your contacts</string>
<key>NSMicrophoneUsageDescription</key> <key>NSMicrophoneUsageDescription</key>
<string>You can use audio and video calls.</string> <string>You can use audio and video calls.</string>
<key>NSPhotoLibraryUsageDescription</key> <key>NSPhotoLibraryUsageDescription</key>
@ -59,6 +60,7 @@
<string>audio</string> <string>audio</string>
<string>fetch</string> <string>fetch</string>
<string>location</string> <string>location</string>
<string>processing</string>
<string>remote-notification</string> <string>remote-notification</string>
<string>voip</string> <string>voip</string>
</array> </array>

View File

@ -3,7 +3,7 @@
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
import UIKit import UIKit
//import Firebase import UserNotifications
import os import os
@UIApplicationMain @UIApplicationMain
@ -70,10 +70,17 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
window?.backgroundColor = UIColor.white window?.backgroundColor = UIColor.white
window?.makeKeyAndVisible() window?.makeKeyAndVisible()
// FirebaseApp.configure()
//
// Messaging.messaging().delegate = self
UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound, .badge]) { (granted, error) in
if granted {
DispatchQueue.main.async {
UIApplication.shared.registerForRemoteNotifications()
}
} else {
print("Permission for push notifications denied.")
}
}
if #available(iOS 10.0, *) { if #available(iOS 10.0, *) {
UNUserNotificationCenter.current().delegate = self UNUserNotificationCenter.current().delegate = self
@ -89,8 +96,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
} }
application.registerForRemoteNotifications() application.registerForRemoteNotifications()
// HINT: try to go online every 47 minutes // HINT: try to go online every 5 minutes
let bgfetchInterval: TimeInterval = 47 * 60 let bgfetchInterval: TimeInterval = 5 * 60
application.setMinimumBackgroundFetchInterval(bgfetchInterval); application.setMinimumBackgroundFetchInterval(bgfetchInterval);
os_log("AppDelegate:didFinishLaunchingWithOptions:end") os_log("AppDelegate:didFinishLaunchingWithOptions:end")
@ -122,7 +129,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
os_log("AppDelegate:applicationDidEnterBackground:PushSelf:start") os_log("AppDelegate:applicationDidEnterBackground:PushSelf:start")
let coord = self.coordinator.activeCoordinator let coord = self.coordinator.activeCoordinator
let runcoord = coord as! RunningCoordinator let runcoord = coord as! RunningCoordinator
runcoord.activeSessionCoordinator?.toxManager.chats.sendOwnPush()
} else { } else {
os_log("AppDelegate:applicationDidEnterBackground:PushSelf:longer-bg-mode not active in settings") os_log("AppDelegate:applicationDidEnterBackground:PushSelf:longer-bg-mode not active in settings")
} }
@ -237,6 +243,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, func application(_ application: UIApplication,
didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) { didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
let token = deviceToken.map { String(format: "%02.2hhx", $0) }.joined()
// TODO(Tha_14): Save the token in db.
print("Device Token: \(token)")
print("APNs token retrieved: \(deviceToken)") print("APNs token retrieved: \(deviceToken)")
os_log("AppDelegate:didRegisterForRemoteNotificationsWithDeviceToken") os_log("AppDelegate:didRegisterForRemoteNotificationsWithDeviceToken")
} }

View File

@ -46,6 +46,8 @@ private extension SettingsAdvancedController {
restoreDefaultsModel.title = String(localized: "settings_restore_default") restoreDefaultsModel.title = String(localized: "settings_restore_default")
restoreDefaultsModel.didSelectHandler = restoreDefaultsSettings restoreDefaultsModel.didSelectHandler = restoreDefaultsSettings
//TODO(Tha_14): Add description text regarding use with tor, UDP required Disabled.
} }
func UDPChanged(_ on: Bool) { func UDPChanged(_ on: Bool) {

View File

@ -20,6 +20,8 @@ enum UserStatus {
self = .away self = .away
case (_, .busy): case (_, .busy):
self = .busy self = .busy
default:
self = .offline
} }
} }

86
Antidote/dark-theme.yaml Normal file
View File

@ -0,0 +1,86 @@
version: 1
colors:
white: FFFFFF
transparent_white: FFFFFF55
transparent_dark_gray: 413839DD
black: "000000"
gray: CCCCCC
lightgraypink: EFEFF4
darkgray: AAAAAA
color_offline_status: "A3A3A3"
darkgray2: 8C8C8C
lightgrayblue: EDF3F5
simpleblue: 2E76D3
mediumblue: 00A7E9
lightblue: 9CBDE9
purple: 575CCF
green: 85B452
green_bright: 00D116
yellow: FFF300
pushyellow: FFC533
red: E94F42
palered: C56258
rust: B7410E
values:
login-background: white
login-gradient: lightblue
login-tox-logo: simpleblue
login-button-text: white
login-button-background: simpleblue
login-description-label: white
login-form-background: white
login-form-text: black
login-link-color: white
# Color used for fullscreen translucent views background, e.g. fullscreen picker
translucent-background: transparent_white
# normal background color used all over application
normal-background: white
normal-text: black
link-text: simpleblue
connecting-background: simpleblue
connecting-text: white
separators-and-borders: gray
rounded-button-text: white
rounded-positive-button-background: simpleblue
rounded-negative-button-background: gray
offline-status: color_offline_status
online-status: green_bright
away-status: yellow
busy-status: palered
status-background: white
friend-cell-status: darkgray2
chat-list-cell-message: darkgray
chat-list-cell-unread-background: lightgrayblue
chat-input-background: lightgrayblue
chat-incoming-bubble: lightgrayblue
chat-outgoing-bubble: purple
chat-outgoing-unread-bubble: rust
chat-outgoing-sentpush-bubble: pushyellow
chat-information-text: darkgray2
tab-badge-background: palered
tab-badge-text: white
tab-item-active: simpleblue
tab-item-inactive: darkgray2
notification-background: transparent_dark_gray
notification-text: white
settings-background: lightgraypink
call-text-color: white
call-decline-button-background: red
call-answer-button-background: green
call-control-background: simpleblue
call-control-selected-background: white
call-button-icon-color: white
call-button-selected-icon-color: simpleblue
call-video-preview-background: black
empty-screen-placeholder-text: darkgray
file-image-background-active: darkgray
file-image-cancelled-text: white
file-image-accept-button-tint: white
file-image-cancel-button-tint: black
lock-gradient-top: mediumblue
lock-gradient-bottom: purple
chat-list-cell-arrow-unread-background: red

View File

@ -15,7 +15,6 @@ def common_pods
pod 'JGProgressHUD', '~> 1.4.0' pod 'JGProgressHUD', '~> 1.4.0'
pod 'SnapKit', '~> 5.6.0' pod 'SnapKit', '~> 5.6.0'
pod 'Yaml', '~> 3.4.4' pod 'Yaml', '~> 3.4.4'
pod 'Firebase/Messaging', '~> 8.15.0'
end end
target :Antidote do target :Antidote do

View File

@ -12,7 +12,7 @@
#import "OCTSendMessageOperation.h" #import "OCTSendMessageOperation.h"
#import "OCTTox+Private.h" #import "OCTTox+Private.h"
#import "OCTToxOptions+Private.h" #import "OCTToxOptions+Private.h"
#import "Firebase.h" //#import "Firebase.h"
@interface OCTSubmanagerChatsImpl () @interface OCTSubmanagerChatsImpl ()
@ -71,18 +71,6 @@
- (void)sendOwnPush - (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 - (void)sendMessagePushToChat:(OCTChat *)chat
@ -499,13 +487,6 @@ triggerPush(NSString *used_pushToken,
NSString *publicKey = [[self.dataSource managerGetTox] publicKeyFromFriendNumber:friendNumber error:nil]; NSString *publicKey = [[self.dataSource managerGetTox] publicKeyFromFriendNumber:friendNumber error:nil];
OCTFriend *friend = [realmManager friendWithPublicKey:publicKey]; 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]; OCTChat *chat = [realmManager getOrCreateChatWithFriend:friend];
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"chatUniqueIdentifier == %@ AND messageText.messageId == %d", NSPredicate *predicate = [NSPredicate predicateWithFormat:@"chatUniqueIdentifier == %@ AND messageText.messageId == %d",

View File

@ -8,7 +8,7 @@
#import "OCTFriend.h" #import "OCTFriend.h"
#import "OCTFriendRequest.h" #import "OCTFriendRequest.h"
#import "OCTRealmManager.h" #import "OCTRealmManager.h"
#import "Firebase.h" //#import "Firebase.h"
@implementation OCTSubmanagerFriendsImpl @implementation OCTSubmanagerFriendsImpl
@synthesize dataSource = _dataSource; @synthesize dataSource = _dataSource;
@ -232,12 +232,11 @@
NSString *publicKey = [[self.dataSource managerGetTox] publicKeyFromFriendNumber:friendNumber error:nil]; NSString *publicKey = [[self.dataSource managerGetTox] publicKeyFromFriendNumber:friendNumber error:nil];
OCTFriend *friend = [realmManager friendWithPublicKey:publicKey]; OCTFriend *friend = [realmManager friendWithPublicKey:publicKey];
if (friend.msgv3Capability != msgv3Capability) //TODO(Tha_14): Remove this after removing msgv3 stuff
{ [realmManager updateObject:friend withBlock:^(OCTFriend *theFriend) {
[realmManager updateObject:friend withBlock:^(OCTFriend *theFriend) { theFriend.msgv3Capability = 0;
theFriend.msgv3Capability = msgv3Capability; }];
}];
}
} }
- (void)tox:(OCTTox *)tox friendConnectionStatusChanged:(OCTToxConnectionStatus)status friendNumber:(OCTToxFriendNumber)friendNumber - (void)tox:(OCTTox *)tox friendConnectionStatusChanged:(OCTToxConnectionStatus)status friendNumber:(OCTToxFriendNumber)friendNumber
@ -255,26 +254,11 @@
{ {
// Friend is coming online now // Friend is coming online now
OCTToxCapabilities f_caps = [tox friendGetCapabilitiesWithFriendNumber:friendNumber]; // OCTToxCapabilities f_caps = [tox friendGetCapabilitiesWithFriendNumber:friendNumber];
OCTLogVerbose(@"f_caps=%lu", f_caps); // OCTLogVerbose(@"f_caps=%lu", f_caps);
NSString* cap_string = [NSString stringWithFormat:@"%lu", f_caps]; // NSString* cap_string = [NSString stringWithFormat:@"%lu", f_caps];
theFriend.capabilities2 = cap_string; // 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.isConnected = (status != OCTToxConnectionStatusNone);
theFriend.connectionStatus = status; theFriend.connectionStatus = status;

View File

@ -17,9 +17,9 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string> <string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>1.4.28</string> <string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>142800</string> <string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSExtension</key> <key>NSExtension</key>
<dict> <dict>
<key>NSExtensionPointIdentifier</key> <key>NSExtensionPointIdentifier</key>