keep refactoring

This commit is contained in:
Benjamin Reis 2018-02-12 16:41:42 +01:00
parent 0b95ccd9df
commit 82a0c63d2e

View file

@ -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<CNLabeledValue<CNInstantMessageAddress *> *> *tmpSipAddresses = [_person.instantMessageAddresses mutableCopy];
[tmpSipAddresses addObject:sipAddress];