"Fossies" - the Fresh Open Source Software Archive

Member "jitsi-meet-7685/ios/sdk/src/JitsiMeetUserInfo.m" (29 Nov 2023, 1490 Bytes) of package /linux/misc/jitsi-meet-7685.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Matlab source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 /*
    2  * Copyright @ 2019-present 8x8, Inc.
    3  *
    4  * Licensed under the Apache License, Version 2.0 (the "License");
    5  * you may not use this file except in compliance with the License.
    6  * You may obtain a copy of the License at
    7  *
    8  *     http://www.apache.org/licenses/LICENSE-2.0
    9  *
   10  * Unless required by applicable law or agreed to in writing, software
   11  * distributed under the License is distributed on an "AS IS" BASIS,
   12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   13  * See the License for the specific language governing permissions and
   14  * limitations under the License.
   15  */
   16 
   17 #import "JitsiMeetUserInfo+Private.h"
   18 
   19 @implementation JitsiMeetUserInfo
   20 
   21 - (instancetype)initWithDisplayName:(NSString *)displayName
   22                            andEmail:(NSString *)email
   23                           andAvatar:(NSURL *_Nullable) avatar {
   24     self = [super init];
   25     if (self) {
   26         self.displayName = displayName;
   27         self.email = email;
   28         self.avatar = avatar;
   29     }
   30 
   31     return self;
   32 }
   33 
   34 - (NSDictionary *)asDict {
   35     NSMutableDictionary *dict = [[NSMutableDictionary alloc] init];
   36 
   37     if (self.displayName != nil) {
   38         dict[@"displayName"] = self.displayName;
   39     }
   40 
   41     if (self.email != nil) {
   42         dict[@"email"] = self.email;
   43     }
   44 
   45     if (self.avatar != nil) {
   46         NSString *avatarURL = [self.avatar absoluteString];
   47         if (avatarURL != nil) {
   48             dict[@"avatarURL"] = avatarURL;
   49         }
   50     }
   51 
   52     return dict;
   53 }
   54 
   55 @end