From 82a0c63d2eac3cf60d07b7a2c57ffb2c8e974bde Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Mon, 12 Feb 2018 16:41:42 +0100 Subject: [PATCH] keep refactoring --- Classes/Contact.m | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Classes/Contact.m b/Classes/Contact.m index c7182ff86..d01d1b759 100644 --- a/Classes/Contact.m +++ b/Classes/Contact.m @@ -265,13 +265,9 @@ if (![sip isEqualToString:@" "]) { if (_person) { - normSip = sip; + normSip = [sip containsString:@"@"] ? [sip componentsSeparatedByString:@"@"][0] : sip; CNInstantMessageAddress *cNSipMsgAddr; - if ([normSip containsString:@"@"]) - cNSipMsgAddr = [[CNInstantMessageAddress alloc] initWithUsername:[normSip componentsSeparatedByString:@"@"][0] service:@"SIP"]; //service:[normSip componentsSeparatedByString:@"@"][1]]; - else - cNSipMsgAddr = [[CNInstantMessageAddress alloc] initWithUsername:normSip service:@"SIP"]; - + cNSipMsgAddr = [[CNInstantMessageAddress alloc] initWithUsername:normSip service:@"SIP"]; //service:[normSip componentsSeparatedByString:@"@"][1]]; CNLabeledValue *sipAddress = [CNLabeledValue labeledValueWithLabel:NULL value:cNSipMsgAddr]; NSMutableArray *> *tmpSipAddresses = [_person.instantMessageAddresses mutableCopy]; [tmpSipAddresses addObject:sipAddress];