Auto answer by default when coming from a local notification

This commit is contained in:
Guillaume BIENKOWSKI 2014-05-22 17:26:47 +02:00
parent 515a4a550b
commit 399b01ba40
8 changed files with 24 additions and 3 deletions

View file

@ -276,11 +276,14 @@
if([notification.userInfo objectForKey:@"callId"] != nil) {
BOOL auto_answer = TRUE;
// some local notifications have an internal timer to relaunch themselves at specified intervals
if( [[notification.userInfo objectForKey:@"timer"] intValue] == 1 ){
[[LinphoneManager instance] cancelLocalNotifTimerForCallId:[notification.userInfo objectForKey:@"callId"]];
} else {
// auto answer only for non-timed local notifications
auto_answer = [[LinphoneManager instance] lpConfigBoolForKey:@"autoanswer_notif_preference"];
}
if(auto_answer)
{
[[LinphoneManager instance] acceptCallForCallId:[notification.userInfo objectForKey:@"callId"]];
}
} else if([notification.userInfo objectForKey:@"from"] != nil) {

View file

@ -209,7 +209,8 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args);
[self setBool: lp_config_get_int(conf,LINPHONERC_APPLICATION_KEY,"start_at_boot_preference",1) forKey:@"start_at_boot_preference"];
[self setBool: lp_config_get_int(conf,LINPHONERC_APPLICATION_KEY,"backgroundmode_preference",1) forKey:@"backgroundmode_preference"];
[self setBool: lp_config_get_int(conf,LINPHONERC_APPLICATION_KEY,"autoanswer_notif_preference",1) forKey:@"autoanswer_notif_preference"];
{
const LinphoneVideoPolicy *pol;
@ -625,6 +626,8 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args);
lp_config_set_int(config, LINPHONERC_APPLICATION_KEY, "backgroundmode_preference", isbackgroundModeEnabled);
lp_config_set_int(config, LINPHONERC_APPLICATION_KEY, "start_at_boot_preference", [self boolForKey:@"start_at_boot_preference"]);
lp_config_set_int(config, LINPHONERC_APPLICATION_KEY, "autoanswer_notif_preference", [self boolForKey:@"autoanswer_notif_preference"]);
BOOL firstloginview = [self boolForKey:@"enable_first_login_view_preference"];
lp_config_set_int(config, LINPHONERC_APPLICATION_KEY, "enable_first_login_view_preference", firstloginview);

View file

@ -28,6 +28,7 @@ edge_opt_preference=0
use_system_contacts=0
start_at_boot_preference=1
backgroundmode_preference=1
autoanswer_notif_preference=1
[default_values]

View file

@ -28,6 +28,7 @@ edge_opt_preference=0
use_system_contacts=0
start_at_boot_preference=1
backgroundmode_preference=1
autoanswer_notif_preference=1
[default_values]
reg_expires=600

View file

@ -86,6 +86,16 @@
<key>Type</key>
<string>PSToggleSwitchSpecifier</string>
</dict>
<dict>
<key>DefaultValue</key>
<true/>
<key>Key</key>
<string>autoanswer_notif_preference</string>
<key>Title</key>
<string>Auto-answer after notification</string>
<key>Type</key>
<string>PSToggleSwitchSpecifier</string>
</dict>
<dict>
<key>DefaultValue</key>
<true/>

View file

@ -52,3 +52,4 @@
/* Landscape */
"Landscape" = "Landscape";
"Auto-answer after notification" = "Auto-answer after notification";

View file

@ -52,3 +52,4 @@
/* Landscape */
"Landscape" = "Paysage";
"Auto-answer after notification" = "Réponse auto. sur notification";

View file

@ -52,3 +52,4 @@
/* Landscape */
"Landscape" = "Альбомный";
"Auto-answer after notification" = "Auto-answer after notification";