Auto-subscribe to contacts at configured telephony provider

This commit is contained in:
Matthew Wild 2023-04-19 15:49:55 +01:00
parent a7769a7b03
commit ca6a3c7e16

View file

@ -147,6 +147,8 @@ class NotificationCenterDelegate: NSObject, UNUserNotificationCenterDelegate {
}
if (Settings.AutoSubscribeOnAcceptedSubscriptionRequest.getBool()) {
presenceModule.subscribe(to: JID(senderJid));
} else if let telephonyProvider = AccountSettings.telephonyProvider(accountJid).getString(), JID(senderJid).domain.lowercased() == telephonyProvider.lowercased() {
presenceModule.subscribe(to: JID(senderJid));
} else {
let alert2 = UIAlertController(title: "Subscribe to " + senderName, message: "Do you wish to subscribe to \n\(senderName)\non account \(accountJid.stringValue)", preferredStyle: .alert);
alert2.addAction(UIAlertAction(title: "Accept", style: .default, handler: {(action) in