-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #96 from makinosp/develop
Develop
- Loading branch information
Showing
12 changed files
with
97 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// | ||
// UserModel+Encodable.swift | ||
// VRCKit | ||
// | ||
// Created by makinosp on 2024/10/27. | ||
// | ||
|
||
import Foundation | ||
|
||
extension User: Encodable { | ||
public func encode(to encoder: any Encoder) throws { | ||
var container = encoder.container(keyedBy: UserCodingKeys.self) | ||
try container.encode(activeFriends, forKey: .activeFriends) | ||
try container.encode(allowAvatarCopying, forKey: .allowAvatarCopying) | ||
try container.encodeIfPresent(bio, forKey: .bio) | ||
try container.encode(bioLinks.wrappedValue, forKey: .bioLinks) | ||
try container.encode(currentAvatar, forKey: .currentAvatar) | ||
try container.encodeIfPresent(avatarImageUrl, forKey: .currentAvatarImageUrl) | ||
try container.encodeIfPresent(avatarThumbnailUrl, forKey: .currentAvatarThumbnailImageUrl) | ||
if let dateJoined = dateJoined { | ||
let dateJoinedString = DateFormatter.dateStringFormat.string(from: dateJoined) | ||
try container.encode(dateJoinedString, forKey: .dateJoined) | ||
} | ||
try container.encode(displayName, forKey: .displayName) | ||
try container.encode(friendKey, forKey: .friendKey) | ||
try container.encode(friends, forKey: .friends) | ||
try container.encode(homeLocation, forKey: .homeLocation) | ||
try container.encode(id, forKey: .id) | ||
try container.encode(isFriend, forKey: .isFriend) | ||
try container.encode(lastActivity, forKey: .lastActivity) | ||
try container.encode(lastLogin, forKey: .lastLogin) | ||
try container.encode(lastPlatform, forKey: .lastPlatform) | ||
try container.encode(offlineFriends, forKey: .offlineFriends) | ||
try container.encode(onlineFriends, forKey: .onlineFriends) | ||
try container.encode(pastDisplayNames, forKey: .pastDisplayNames) | ||
try container.encodeIfPresent(profilePicOverride, forKey: .profilePicOverride) | ||
try container.encode(state, forKey: .state) | ||
try container.encode(status, forKey: .status) | ||
try container.encode(statusDescription, forKey: .statusDescription) | ||
try container.encode(tags, forKey: .tags) | ||
try container.encode(twoFactorAuthEnabled, forKey: .twoFactorAuthEnabled) | ||
try container.encodeIfPresent(userIcon, forKey: .userIcon) | ||
try container.encodeIfPresent(userLanguage, forKey: .userLanguage) | ||
try container.encodeIfPresent(userLanguageCode, forKey: .userLanguageCode) | ||
try container.encode(presence, forKey: .presence) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters