Skip to content
Snippets Groups Projects
Commit 0a22c8fd authored by Alexandre Lision's avatar Alexandre Lision Committed by Alexandre Lision
Browse files

call: detect ring calls to prepend 'ring:'

Refs #67102

Change-Id: I7655cf5ffe3c63e459636bdd72e1ed9505627bdb
parent bb306135
No related branches found
No related tags found
No related merge requests found
...@@ -201,7 +201,17 @@ static NSString* const kCallButtonIdentifer = @"CallButtonIdentifier"; ...@@ -201,7 +201,17 @@ static NSString* const kCallButtonIdentifer = @"CallButtonIdentifier";
- (IBAction)placeCall:(id)sender - (IBAction)placeCall:(id)sender
{ {
Call* c = CallModel::instance()->dialingCall(); Call* c = CallModel::instance()->dialingCall();
// check for a valid ring hash
NSCharacterSet *hexSet = [NSCharacterSet characterSetWithCharactersInString:@"0123456789abcdefABCDEF"];
BOOL valid = [[[callField stringValue] stringByTrimmingCharactersInSet:hexSet] isEqualToString:@""];
if(valid && callField.stringValue.length == 40) {
c->setDialNumber(QString::fromNSString([NSString stringWithFormat:@"ring:%@",[callField stringValue]]));
} else {
c->setDialNumber(QString::fromNSString([callField stringValue])); c->setDialNumber(QString::fromNSString([callField stringValue]));
}
c << Call::Action::ACCEPT; c << Call::Action::ACCEPT;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment