From 2b64f48bc6acb79bd2844333afea7e7a70d77a22 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Wed, 23 Mar 2022 10:14:33 -0500 Subject: move Info factory to extensions --- src/slskd/Users/Extensions.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/slskd/Users/Extensions.cs') diff --git a/src/slskd/Users/Extensions.cs b/src/slskd/Users/Extensions.cs index 846fd125..d2189a20 100644 --- a/src/slskd/Users/Extensions.cs +++ b/src/slskd/Users/Extensions.cs @@ -47,5 +47,20 @@ namespace slskd.Users IsPrivileged = s.IsPrivileged, Presence = s.Presence, }; + + /// + /// Converts to . + /// + /// The UserInfo instance to convert. + /// The converted instance. + public static Info ToInfo(this UserInfo i) => new() + { + Description = i.Description, + HasFreeUploadSlot = i.HasFreeUploadSlot, + HasPicture = i.HasPicture, + Picture = i.Picture, + QueueLength = i.QueueLength, + UploadSlots = i.UploadSlots, + }; } } -- cgit v1.2.3