Skip to content

Commit 30303cf

Browse files
Merge branch 'main' into access-control-page-ui-updation
2 parents 32386aa + 7b89982 commit 30303cf

4 files changed

Lines changed: 59 additions & 54 deletions

File tree

deltachat-ios.xcodeproj/project.pbxproj

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1701,6 +1701,7 @@
17011701
};
17021702
A1B2C3D4E5F6A7B8C9D0E1F2 /* Strip Simulator Archs */ = {
17031703
isa = PBXShellScriptBuildPhase;
1704+
alwaysOutOfDate = 1;
17041705
buildActionMask = 2147483647;
17051706
files = (
17061707
);
@@ -2208,7 +2209,7 @@
22082209
CODE_SIGN_ENTITLEMENTS = DcShare/DcShare.entitlements;
22092210
CODE_SIGN_IDENTITY = "iPhone Developer";
22102211
CODE_SIGN_STYLE = Automatic;
2211-
CURRENT_PROJECT_VERSION = 16;
2212+
CURRENT_PROJECT_VERSION = 1;
22122213
DEVELOPMENT_TEAM = 9WB6484ZRW;
22132214
ENABLE_BITCODE = NO;
22142215
FRAMEWORK_SEARCH_PATHS = (
@@ -2223,6 +2224,7 @@
22232224
"@executable_path/Frameworks",
22242225
"@executable_path/../../Frameworks",
22252226
);
2227+
MARKETING_VERSION = 1.1.0;
22262228
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
22272229
MTL_FAST_MATH = YES;
22282230
OTHER_CFLAGS = (
@@ -2253,7 +2255,7 @@
22532255
CODE_SIGN_ENTITLEMENTS = DcShare/DcShare.entitlements;
22542256
CODE_SIGN_IDENTITY = "iPhone Developer";
22552257
CODE_SIGN_STYLE = Automatic;
2256-
CURRENT_PROJECT_VERSION = 16;
2258+
CURRENT_PROJECT_VERSION = 1;
22572259
DEVELOPMENT_TEAM = 9WB6484ZRW;
22582260
ENABLE_BITCODE = NO;
22592261
FRAMEWORK_SEARCH_PATHS = (
@@ -2268,6 +2270,7 @@
22682270
"@executable_path/Frameworks",
22692271
"@executable_path/../../Frameworks",
22702272
);
2273+
MARKETING_VERSION = 1.1.0;
22712274
MTL_FAST_MATH = YES;
22722275
OTHER_CFLAGS = (
22732276
"$(inherited)",
@@ -2481,7 +2484,7 @@
24812484
CODE_SIGN_ENTITLEMENTS = "deltachat-ios/deltachat-ios-debug.entitlements";
24822485
CODE_SIGN_IDENTITY = "iPhone Developer";
24832486
CODE_SIGN_STYLE = Automatic;
2484-
CURRENT_PROJECT_VERSION = 16;
2487+
CURRENT_PROJECT_VERSION = 1;
24852488
DEVELOPMENT_TEAM = 9WB6484ZRW;
24862489
ENABLE_BITCODE = NO;
24872490
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
@@ -2505,7 +2508,7 @@
25052508
"$(PROJECT_DIR)/deltachat-ios/libraries/deltachat-core-rust/deltachat-ffi",
25062509
"$(PROJECT_DIR)/deltachat-ios/libraries",
25072510
);
2508-
MARKETING_VERSION = 1.0.0;
2511+
MARKETING_VERSION = 1.1.0;
25092512
OTHER_CFLAGS = (
25102513
"$(inherited)",
25112514
"-isystem",
@@ -2557,7 +2560,7 @@
25572560
CODE_SIGN_ENTITLEMENTS = "deltachat-ios/deltachat-ios.entitlements";
25582561
CODE_SIGN_IDENTITY = "iPhone Developer";
25592562
CODE_SIGN_STYLE = Automatic;
2560-
CURRENT_PROJECT_VERSION = 16;
2563+
CURRENT_PROJECT_VERSION = 1;
25612564
DEVELOPMENT_TEAM = 9WB6484ZRW;
25622565
ENABLE_BITCODE = NO;
25632566
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
@@ -2581,7 +2584,7 @@
25812584
"$(PROJECT_DIR)/deltachat-ios/libraries/deltachat-core-rust/deltachat-ffi",
25822585
"$(PROJECT_DIR)/deltachat-ios/libraries",
25832586
);
2584-
MARKETING_VERSION = 1.0.0;
2587+
MARKETING_VERSION = 1.1.0;
25852588
OTHER_CFLAGS = (
25862589
"$(inherited)",
25872590
"-isystem",
@@ -2631,7 +2634,7 @@
26312634
CODE_SIGN_ENTITLEMENTS = DcNotificationService/DcNotificationService.entitlements;
26322635
CODE_SIGN_IDENTITY = "iPhone Developer";
26332636
CODE_SIGN_STYLE = Automatic;
2634-
CURRENT_PROJECT_VERSION = 16;
2637+
CURRENT_PROJECT_VERSION = 1;
26352638
DEVELOPMENT_TEAM = 9WB6484ZRW;
26362639
ENABLE_USER_SCRIPT_SANDBOXING = YES;
26372640
GCC_C_LANGUAGE_STANDARD = gnu17;
@@ -2646,6 +2649,7 @@
26462649
"@executable_path/../../Frameworks",
26472650
);
26482651
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
2652+
MARKETING_VERSION = 1.1.0;
26492653
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
26502654
MTL_FAST_MATH = YES;
26512655
PRODUCT_BUNDLE_IDENTIFIER = chat.privitty.DcNotificationServices;
@@ -2667,7 +2671,7 @@
26672671
CODE_SIGN_ENTITLEMENTS = DcNotificationService/DcNotificationService.entitlements;
26682672
CODE_SIGN_IDENTITY = "iPhone Developer";
26692673
CODE_SIGN_STYLE = Automatic;
2670-
CURRENT_PROJECT_VERSION = 16;
2674+
CURRENT_PROJECT_VERSION = 1;
26712675
DEVELOPMENT_TEAM = 9WB6484ZRW;
26722676
ENABLE_USER_SCRIPT_SANDBOXING = YES;
26732677
GCC_C_LANGUAGE_STANDARD = gnu17;
@@ -2682,6 +2686,7 @@
26822686
"@executable_path/../../Frameworks",
26832687
);
26842688
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
2689+
MARKETING_VERSION = 1.1.0;
26852690
MTL_FAST_MATH = YES;
26862691
PRODUCT_BUNDLE_IDENTIFIER = chat.privitty.DcNotificationServices;
26872692
PRODUCT_NAME = PrvNotificationService;
@@ -2703,7 +2708,7 @@
27032708
CODE_SIGN_ENTITLEMENTS = "deltachat-ios/deltachat-ios-debug.entitlements";
27042709
CODE_SIGN_IDENTITY = "iPhone Developer";
27052710
CODE_SIGN_STYLE = Automatic;
2706-
CURRENT_PROJECT_VERSION = 16;
2711+
CURRENT_PROJECT_VERSION = 1;
27072712
DEVELOPMENT_TEAM = 9WB6484ZRW;
27082713
ENABLE_USER_SCRIPT_SANDBOXING = YES;
27092714
GCC_C_LANGUAGE_STANDARD = gnu17;
@@ -2718,6 +2723,7 @@
27182723
"@executable_path/../../Frameworks",
27192724
);
27202725
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
2726+
MARKETING_VERSION = 1.1.0;
27212727
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
27222728
MTL_FAST_MATH = YES;
27232729
PRODUCT_BUNDLE_IDENTIFIER = chat.privitty.DcWidget;
@@ -2741,7 +2747,7 @@
27412747
CODE_SIGN_ENTITLEMENTS = "deltachat-ios/deltachat-ios.entitlements";
27422748
CODE_SIGN_IDENTITY = "iPhone Developer";
27432749
CODE_SIGN_STYLE = Automatic;
2744-
CURRENT_PROJECT_VERSION = 16;
2750+
CURRENT_PROJECT_VERSION = 1;
27452751
DEVELOPMENT_TEAM = 9WB6484ZRW;
27462752
ENABLE_USER_SCRIPT_SANDBOXING = YES;
27472753
GCC_C_LANGUAGE_STANDARD = gnu17;
@@ -2756,6 +2762,7 @@
27562762
"@executable_path/../../Frameworks",
27572763
);
27582764
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
2765+
MARKETING_VERSION = 1.1.0;
27592766
MTL_FAST_MATH = YES;
27602767
PRODUCT_BUNDLE_IDENTIFIER = chat.privitty.DcWidget;
27612768
PRODUCT_NAME = PrvWidget;

deltachat-ios/AppDelegate.swift

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
667667
}
668668

669669
if let dataJson = dataJson {
670-
// Check if dataJson has "pdu" key (matches Android: dataJson.has("pdu"))
670+
// Only send a reply PDU if the response contains one.
671+
// Some message types (e.g. ADD_MEMBER_TO_GROUP, ACCESS_REVOKED)
672+
// are receive-only and produce no reply PDU — that is normal.
671673
if let pdu = dataJson["pdu"] as? String {
672674
// Extract chat_id from response (matches Android: dataJson.has("chat_id"))
673675
// Note: chat_id might be Int or String, handle both cases
@@ -680,7 +682,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
680682
}
681683

682684
if let puntChatId = puntChatId {
683-
// Use chat_id from response to send PDU (matches Android: puntChatId)
684685
let msg = dcContext.newMessage(viewType: DC_MSG_TEXT)
685686
msg.text = pdu
686687
dcContext.sendMessage(chatId: puntChatId, message: msg)
@@ -689,12 +690,13 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
689690
logger.error("Privitty: chat_id value: \(String(describing: dataJson["chat_id"])), type: \(type(of: dataJson["chat_id"]))")
690691
}
691692
} else {
692-
logger.error("Privitty: PDU is missing in dataJson")
693-
logger.error("Privitty: pdu value: \(String(describing: dataJson["pdu"])), type: \(type(of: dataJson["pdu"]))")
693+
// No reply PDU — this message type is receive-only (processed successfully).
694+
logger.debug("Privitty: Message processed successfully — no reply PDU required for this message type")
694695
}
695696
} else {
696-
logger.error("Privitty: Could not extract dataJson from response")
697-
logger.error("Privitty: dataDataJson does not have nested 'data' key and does not contain 'pdu' directly")
697+
// dataDataJson has neither a nested 'data' nor a 'pdu' key.
698+
// This is normal for receive-only handlers (e.g. ADD_MEMBER_TO_GROUP).
699+
logger.debug("Privitty: Message processed successfully — no reply PDU in response (receive-only handler)")
698700
}
699701
} else {
700702
logger.error("Privitty: data.data is missing or not a dictionary")
@@ -782,39 +784,37 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
782784
dataJson = dataDataJson
783785
}
784786

785-
if let dataJson = dataJson {
786-
// Check if dataJson has "pdu" key (matches Android: dataJson.has("pdu"))
787-
if let pdu = dataJson["pdu"] as? String {
788-
// Extract chat_id from response (matches Android: dataJson.has("chat_id"))
789-
// Note: chat_id might be Int or String, handle both cases
790-
var puntChatId: Int?
791-
if let chatIdInt = dataJson["chat_id"] as? Int {
792-
puntChatId = chatIdInt
793-
} else if let chatIdStr = dataJson["chat_id"] as? String,
794-
let chatIdInt = Int(chatIdStr) {
795-
puntChatId = chatIdInt
796-
}
797-
798-
if let puntChatId = puntChatId {
799-
// Use chat_id from response to send PDU (matches Android: puntChatId)
800-
let msg = dcContext.newMessage(viewType: DC_MSG_TEXT)
801-
msg.text = pdu
802-
dcContext.sendMessage(chatId: puntChatId, message: msg)
803-
} else {
804-
logger.error("Privitty: DC_EVENT_MSGS_CHANGED - chat ID is missing or invalid for the requested PDU")
805-
logger.error("Privitty: DC_EVENT_MSGS_CHANGED - chat_id value: " +
806-
"\(String(describing: dataJson["chat_id"])), " +
807-
"type: \(type(of: dataJson["chat_id"]))")
808-
}
809-
} else {
810-
logger.error("Privitty: DC_EVENT_MSGS_CHANGED - PDU is missing in dataJson")
811-
logger.error("Privitty: DC_EVENT_MSGS_CHANGED - pdu value: " +
812-
"\(String(describing: dataJson["pdu"])), " +
813-
"type: \(type(of: dataJson["pdu"]))")
814-
}
815-
} else {
816-
logger.error("Privitty: DC_EVENT_MSGS_CHANGED - Could not extract dataJson from response")
817-
}
787+
if let dataJson = dataJson {
788+
// Only send a reply PDU if the response contains one.
789+
// Some message types (e.g. ADD_MEMBER_TO_GROUP, ACCESS_REVOKED)
790+
// are receive-only and produce no reply PDU — that is normal.
791+
if let pdu = dataJson["pdu"] as? String {
792+
var puntChatId: Int?
793+
if let chatIdInt = dataJson["chat_id"] as? Int {
794+
puntChatId = chatIdInt
795+
} else if let chatIdStr = dataJson["chat_id"] as? String,
796+
let chatIdInt = Int(chatIdStr) {
797+
puntChatId = chatIdInt
798+
}
799+
800+
if let puntChatId = puntChatId {
801+
let msg = dcContext.newMessage(viewType: DC_MSG_TEXT)
802+
msg.text = pdu
803+
dcContext.sendMessage(chatId: puntChatId, message: msg)
804+
} else {
805+
logger.error("Privitty: DC_EVENT_MSGS_CHANGED - chat ID is missing or invalid for the requested PDU")
806+
logger.error("Privitty: DC_EVENT_MSGS_CHANGED - chat_id value: " +
807+
"\(String(describing: dataJson["chat_id"])), " +
808+
"type: \(type(of: dataJson["chat_id"]))")
809+
}
810+
} else {
811+
// No reply PDU — this message type is receive-only (processed successfully).
812+
logger.debug("Privitty: DC_EVENT_MSGS_CHANGED - Message processed successfully — no reply PDU required for this message type")
813+
}
814+
} else {
815+
// No dataJson found — receive-only handler with no reply PDU needed.
816+
logger.debug("Privitty: DC_EVENT_MSGS_CHANGED - Message processed successfully — no reply PDU in response (receive-only handler)")
817+
}
818818
} else {
819819
logger.error("Privitty: DC_EVENT_MSGS_CHANGED - data.data is missing or not a dictionary")
820820
logger.error("Privitty: DC_EVENT_MSGS_CHANGED - data[\"data\"] value: \(String(describing: data["data"])), type: \(type(of: data["data"]))")

deltachat-ios/DC/PrvContext.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -814,7 +814,7 @@ public class PrvContext {
814814
return (false, nil, nil, "Core not initialized")
815815
}
816816

817-
guard let currentUser = getCurrentUser() else {
817+
guard getCurrentUser() != nil else {
818818
return (false, nil, nil, "No user selected")
819819
}
820820

@@ -824,7 +824,7 @@ public class PrvContext {
824824
}
825825

826826
let message = result["message"] as? String
827-
let appStatus = result["app_status"]
827+
_ = result["app_status"]
828828

829829
let successValue: Bool
830830
if let value = result["success"] as? Bool {
@@ -839,8 +839,6 @@ public class PrvContext {
839839

840840
if successValue {
841841
let data = result["data"] as? [String: Any]
842-
let pduPresent = (data?["pdu"] as? String) != nil
843-
let status = data?["status"] as? String ?? "?"
844842
return (true, data, message, nil)
845843
}
846844

docs/renew-push-certificate.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ These are the steps needed for renewal:
1919

2020
- open <https://developer.apple.com/account/resources/certificates/add>, hit "Create"
2121
- select "Apple Push Notification service SSL (Sandbox & Production)"
22-
- App ID: `8Y...A8.chat.delta`
22+
- App ID: `9W...RW.chat.privitty`
2323
- upload `CertificateSigningRequest.certSigningRequest` from above
2424
- download locally to `certificates/YEAR-push-renew-NUMBER/aps.cer` (do not add to git)
2525

0 commit comments

Comments
 (0)