simplify code

This commit is contained in:
Benjamin Reis 2018-05-24 13:21:02 +02:00
parent fd95a1bc44
commit f5c59248c4

View file

@ -62,42 +62,35 @@ static const CGFloat NOTIFIED_CELL_HEIGHT = 44;
switch (linphone_event_log_get_type(event)) {
case LinphoneEventLogTypeConferenceSubjectChanged: {
NSString *subject = [NSString stringWithUTF8String:linphone_event_log_get_subject(event) ?: LINPHONE_DUMMY_SUBJECT];
NSString *formatedString = [NSString stringWithFormat:@"New subject : %@", subject];
eventString = NSLocalizedString(formatedString, nil);
eventString = [NSString stringWithFormat:NSLocalizedString(@"New subject : %@", nil), subject];
break;
}
case LinphoneEventLogTypeConferenceParticipantAdded: {
NSString *participant = [FastAddressBook displayNameForAddress:linphone_event_log_get_participant_address(event)];
NSString *formatedString = [NSString stringWithFormat:@"%@ has joined", participant];
eventString = NSLocalizedString(formatedString, nil);
eventString = [NSString stringWithFormat:NSLocalizedString(@"%@ has joined", nil), participant];
break;
}
case LinphoneEventLogTypeConferenceParticipantRemoved: {
NSString *participant = [FastAddressBook displayNameForAddress:linphone_event_log_get_participant_address(event)];
NSString *formatedString = [NSString stringWithFormat:@"%@ has left", participant];
eventString = NSLocalizedString(formatedString, nil);
eventString = [NSString stringWithFormat:NSLocalizedString(@"%@ has left", nil), participant];
break;
}
case LinphoneEventLogTypeConferenceParticipantSetAdmin: {
NSString *participant = [FastAddressBook displayNameForAddress:linphone_event_log_get_participant_address(event)];
NSString *formatedString = [NSString stringWithFormat:@"%@ is now an admin", participant];
eventString = NSLocalizedString(formatedString, nil);
eventString = [NSString stringWithFormat:NSLocalizedString(@"%@ is now an admin", nil), participant];
break;
}
case LinphoneEventLogTypeConferenceParticipantUnsetAdmin: {
NSString *participant = [FastAddressBook displayNameForAddress:linphone_event_log_get_participant_address(event)];
NSString *formatedString = [NSString stringWithFormat:@"%@ is no longer an admin", participant];
eventString = NSLocalizedString(formatedString, nil);
eventString = [NSString stringWithFormat:NSLocalizedString(@"%@ is no longer an admin", nil), participant];
break;
}
case LinphoneEventLogTypeConferenceTerminated: {
NSString *formatedString = [NSString stringWithFormat:@"You have left the group"];
eventString = NSLocalizedString(formatedString, nil);
eventString = [NSString stringWithFormat:NSLocalizedString(@"You have left the group", nil)];
break;
}
case LinphoneEventLogTypeConferenceCreated: {
NSString *formatedString = [NSString stringWithFormat:@"You have joined the group"];
eventString = NSLocalizedString(formatedString, nil);
eventString = [NSString stringWithFormat:NSLocalizedString(@"You have joined the group", nil)];
break;
}
default: