Permalink
Browse files

Added an option to always allow subscribe authorisations.

This can be help full when you have a bunch of autogenerated contact.
  • Loading branch information...
CyrilPeponnet committed Mar 28, 2016
1 parent 7ea7558 commit 13321e10685661df8bf786588ccc311df77814ed
@@ -270,15 +270,21 @@
else
nick = [requestStanza from];
var alert = [TNAlert alertWithMessage:CPLocalizedString(@"Subscription request", @"Subscription request")
informative:nick + CPLocalizedString(@" is asking you subscription. Do you want to authorize it ?", @" is asking you subscription. Do you want to authorize it ?")
target:self
actions:[[CPLocalizedString("Accept", "Accept"), @selector(performAuthorize:)],
[CPLocalizedString("Decline", "Decline"), @selector(performRefuse:)]]];
[alert setHelpTarget:self action:@selector(showHelpForSubscription:)];
[alert setUserInfo:requestStanza]
[alert runModal];
if (![[CPUserDefaults standardUserDefaults] boolForKey:@"TNArchipelContactAlwaysAuthorize"]){
var alert = [TNAlert alertWithMessage:CPLocalizedString(@"Subscription request", @"Subscription request")
informative:nick + CPLocalizedString(@" is asking you subscription. Do you want to authorize it ?", @" is asking you subscription. Do you want to authorize it ?")
target:self
actions:[[CPLocalizedString("Accept", "Accept"), @selector(performAuthorize:)],
[CPLocalizedString("Decline", "Decline"), @selector(performRefuse:)]]];
[alert setHelpTarget:self action:@selector(showHelpForSubscription:)];
[alert setShowsSuppressionButton:YES];
[alert setUserInfo:requestStanza];
[alert runModal];
}
else
[self performAuthorize:requestStanza]
}
/*! Action of didReceiveSubscriptionRequest's confirmation alert.
@@ -287,6 +293,8 @@
- (void)performAuthorize:(TNStropheStanza)aRequestStanza
{
[[[TNStropheIMClient defaultClient] roster] answerAuthorizationRequest:aRequestStanza answer:YES];
[[CPUserDefaults standardUserDefaults] setBool:YES forKey:@"TNArchipelContactAlwaysAuthorize"];
}
/*! Action of didReceiveSubscriptionRequest's confirmation alert.
@@ -137,7 +137,7 @@ TNPreferencesControllerRestoredNotification = @"TNPreferencesControllerRestoredN
@"TNArchipelXMPPPassword", @"TNArchipelXMPPService", @"TNArchipelRememberCredentials",
@"TNArchipelTagsVisible", @"TNArchipelModuleControllerOpenedTabRegistry",
@"TNArchipelForceJIDDomain", @"TNArchipelForcedJIDDomain",
@"TNUserChatMessageStore", @"TNOutlineViewsExpandedGroups", @"TNArchipelTypeVirtualMachineControlDoNotShowDestroyAlert",@"TNArchipelXMPPServerSaved"];
@"TNUserChatMessageStore", @"TNOutlineViewsExpandedGroups", @"TNArchipelTypeVirtualMachineControlDoNotShowDestroyAlert", @"TNArchipelContactAlwaysAuthorize"];
}
/*! initialize the XMPP storage

0 comments on commit 13321e1

Please sign in to comment.