@@ -22,7 +22,7 @@ internal class OperationLogic(BotContext context) : ILogic
2222 private const string Tag = nameof ( OperationLogic ) ;
2323
2424 public async Task < Dictionary < string , string > > FetchCookies ( List < string > domains ) => ( await context . EventContext . SendEvent < FetchCookiesEventResp > ( new FetchCookiesEventReq ( domains ) ) ) . Cookies ;
25-
25+
2626 public ValueTask < BotSsoPacket > SendPacket ( BotSsoPacket packet , RequestType requestType , EncryptType encryptType )
2727 {
2828 int sequence = packet . Sequence != 0 ? packet . Sequence : context . ServiceContext . GetNewSequence ( ) ;
@@ -88,17 +88,17 @@ public async Task<string> GroupFSDownload(long groupUin, string fileId)
8888 fileName = ResolveFileName ( fileStream , fileName ) ;
8989
9090 var friend = await context . CacheContext . ResolveFriend ( targetUin ) ?? throw new InvalidTargetException ( targetUin ) ;
91-
91+
9292 var buffer = ArrayPool < byte > . Shared . Rent ( 10002432 ) ;
9393 int payload = await fileStream . ReadAsync ( buffer . AsMemory ( 0 , 10002432 ) ) ;
9494 var md510m = MD5 . HashData ( buffer [ ..payload ] ) ;
9595 ArrayPool < byte > . Shared . Return ( buffer ) ;
9696 fileStream . Seek ( 0 , SeekOrigin . Begin ) ;
97-
97+
9898 var request = new FileUploadEventReq ( friend . Uid , fileStream , fileName , md510m ) ;
9999 var result = await context . EventContext . SendEvent < FileUploadEventResp > ( request ) ;
100100
101-
101+
102102 if ( ! result . IsExist )
103103 {
104104 var ext = new FileUploadExt
@@ -241,6 +241,13 @@ public async Task<string> SendGroupFile(long groupUin, Stream fileStream, string
241241 return uploadResp . FileId ;
242242 }
243243
244+ public async Task < BotGroupExtra > FetchGroupExtra ( long groupUin )
245+ {
246+ var req = new FetchGroupExtraEventReq ( groupUin ) ;
247+ var resp = await context . EventContext . SendEvent < FetchGroupExtraEventResp > ( req ) ;
248+ return resp . Extra ;
249+ }
250+
244251 public async Task < List < BotGroupNotificationBase > > FetchGroupNotifications ( ulong count , ulong start )
245252 {
246253 var req = new FetchGroupNotificationsEventReq ( count , start ) ;
0 commit comments