Showing name of contact on outgoing phone call

pull/1/head
Frederic Jacobs 11 years ago
parent 9b4afebbd5
commit af9f8579b6

@ -249,14 +249,16 @@ typedef enum : NSUInteger {
-(PhoneNumber*)phoneNumberForThread -(PhoneNumber*)phoneNumberForThread
{ {
NSString * contactId = [(TSContactThread*)self.thread contactIdentifier]; NSString * contactId = [(TSContactThread*)self.thread contactIdentifier];
PhoneNumber * phoneNumber = [PhoneNumber tryParsePhoneNumberFromUserSpecifiedText:contactId]; return [PhoneNumber tryParsePhoneNumberFromUserSpecifiedText:contactId];
return phoneNumber;
} }
-(void)callAction -(void)callAction
{ {
if ([self isRedPhoneReachable]) { 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 { } else {
DDLogWarn(@"Tried to initiate a call but contact has no RedPhone identifier"); DDLogWarn(@"Tried to initiate a call but contact has no RedPhone identifier");
} }

Loading…
Cancel
Save