Showing name of contact on outgoing phone call

This commit is contained in:
Frederic Jacobs 2014-12-29 11:43:11 +01:00
parent 9b4afebbd5
commit af9f8579b6

View file

@ -249,14 +249,16 @@ typedef enum : NSUInteger {
-(PhoneNumber*)phoneNumberForThread
{
NSString * contactId = [(TSContactThread*)self.thread contactIdentifier];
PhoneNumber * phoneNumber = [PhoneNumber tryParsePhoneNumberFromUserSpecifiedText:contactId];
return phoneNumber;
return [PhoneNumber tryParsePhoneNumberFromUserSpecifiedText:contactId];
}
-(void)callAction
{
if ([self isRedPhoneReachable]) {
[Environment.phoneManager initiateOutgoingCallToRemoteNumber:[self phoneNumberForThread]];
PhoneNumber *number = [self phoneNumberForThread];
Contact *contact = [[Environment.getCurrent contactsManager] latestContactForPhoneNumber:number];
[Environment.phoneManager initiateOutgoingCallToContact:contact atRemoteNumber:number];
} else {
DDLogWarn(@"Tried to initiate a call but contact has no RedPhone identifier");
}