Skip to content
This repository was archived by the owner on Oct 12, 2025. It is now read-only.

Conversation

@DarkRRb
Copy link
Collaborator

@DarkRRb DarkRRb commented May 19, 2025

No description provided.

@DarkRRb DarkRRb force-pushed the darkrrb/feat/implemented-the-recall-poke branch 2 times, most recently from 2ea629b to 0ce26ce Compare May 19, 2025 19:21
Co-authored-by: Decrabbityyy <99632363+Decrabbityyy@users.noreply.github.com>
@DarkRRb DarkRRb force-pushed the darkrrb/feat/implemented-the-recall-poke branch from 0ce26ce to 4c57048 Compare May 19, 2025 19:22
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request implements the new “recall poke” functionality in the core messaging system. The changes introduce new events, services, and protocol definitions to support both group and friend recall poke operations.

  • Added a new RecallPokeService along with supporting protocol buffers for recall poke.
  • Extended push message processing and event invoker logic to handle GroupSysRecallPokeEvent and FriendSysRecallPokeEvent.
  • Updated business and messaging logic with new methods and event argument classes for recall poke actions.

Reviewed Changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated no comments.

Show a summary per file
File Description
Lagrange.Core/Internal/Service/Message/RecallPokeService.cs New service to build and parse recall poke messages.
Lagrange.Core/Internal/Service/Message/PushMessageService.cs Updated event handling to differentiate recall poke from other grey tip events.
Lagrange.Core/Internal/Packets/Service/Oidb/Request/OidbSvcTrpcTcp0xF51_1.cs Added new protocol request definitions for recall poke.
Lagrange.Core/Internal/Packets/Message/Notify/NotifyMessageBody.cs Extended notify message body with recall poke fields.
Lagrange.Core/Internal/Packets/Message/Notify/GroupRecallPoke.cs New DTO representing group recall poke details.
Lagrange.Core/Internal/Event/Notify/GroupSysRecallPokeEvent.cs
Lagrange.Core/Internal/Event/Notify/FriendSysRecallPokeEvent.cs
New event types for group and friend recall poke actions.
Lagrange.Core/Internal/Event/Message/RecallPokeEvent.cs Base recall poke event definition with factory methods.
Lagrange.Core/Internal/Context/Logic/Implementation/OperationLogic.cs Added asynchronous methods to trigger recall poke events.
Lagrange.Core/Internal/Context/Logic/Implementation/MessagingLogic.cs Integrated recall poke events into messaging and event invoker flows.
Lagrange.Core/Event/EventInvoker.cs
Lagrange.Core/Event/EventInvoker.Events.cs
Registered the new recall poke events.
Lagrange.Core/Event/EventArg/GroupRecallPokeEvent .cs
Lagrange.Core/Event/EventArg/FriendRecallPokeEvent.cs
Defined event argument classes for recall poke events.
Lagrange.Core/Common/Interface/Api/OperationExt.cs Exposed API extensions for triggering recall poke operations.
Comments suppressed due to low confidence (3)

Lagrange.Core/Internal/Context/Logic/Implementation/OperationLogic.cs:947

  • [nitpick] The parameter 'groupUin' in the FriendRecallPoke method is ambiguous as it represents a peer's identifier rather than a group. Consider renaming it to 'peerUin' for clarity.
public async Task<(int Code, string Message)> FriendRecallPoke(ulong groupUin, ulong messageSequence, ulong messageTime, ulong tipsSeqId)

Lagrange.Core/Event/EventArg/GroupRecallPokeEvent .cs:1

  • The filename 'GroupRecallPokeEvent .cs' contains an extraneous space, which may lead to inconsistencies in file references. Consider renaming the file to 'GroupRecallPokeEvent.cs'.
namespace Lagrange.Core.Event.EventArg;

Lagrange.Core/Internal/Event/Message/RecallPokeEvent.cs:7

  • [nitpick] The property name 'Uin' is ambiguous as it is used for both group and friend recall poke events. Consider renaming it to a more descriptive term such as 'TargetUid' or separating into distinct properties for group and friend contexts.
public ulong Uin { get; init; }

@DarkRRb DarkRRb requested a review from Copilot May 20, 2025 01:46
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Implements the “recall poke” feature end-to-end, including sending recall requests, parsing incoming recall notifications, propagating new events, and exposing API hooks.

  • Added RecallPokeService to build and parse OIDB recall-poke packets
  • Updated PushMessageService to detect and dispatch group/friend recall-poke from grey-tip messages
  • Introduced new protobuf payloads, protocol events, logic handlers, and BotContext API extensions

Reviewed Changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
Lagrange.Core/Internal/Service/Message/RecallPokeService.cs New service to serialize/deserialize recall-poke requests
Lagrange.Core/Internal/Service/Message/PushMessageService.cs Handle Type == 32 grey-tip for recall poke and dispatch events
Lagrange.Core/Internal/Packets/Message/Notify/NotifyMessageBody.cs, GroupRecallPoke.cs Protobuf models for recall-poke payload
Lagrange.Core/Internal/Event/Notify/GroupSysRecallPokeEvent.cs & FriendSysRecallPokeEvent.cs Protocol events representing recall-poke notifications
Lagrange.Core/Internal/Context/Logic/Implementation/OperationLogic.cs & MessagingLogic.cs Business logic to send recall-poke and route incoming events
Lagrange.Core/Common/Interface/Api/OperationExt.cs Exposed GroupRecallPoke and FriendRecallPoke on BotContext
Comments suppressed due to low confidence (3)

Lagrange.Core/Internal/Event/EventArg/FriendRecallPokeEvent.cs:11

  • Parameter name 'groupUin' is misleading in FriendRecallPokeEvent constructor; it should be renamed to 'peerUin' to match the property and semantics.
public FriendRecallPokeEvent(uint groupUin, uint operatorUin, ulong tipsSeqId)

Lagrange.Core/Internal/Context/Logic/Implementation/OperationLogic.cs:941

  • [nitpick] The error message 'No Result' is vague; consider providing more context or using a constant to improve clarity for the caller.
if (results.Count == 0) return (-1, "No Result");

Lagrange.Core/Internal/Context/Logic/Implementation/OperationLogic.cs:937

  • The new GroupRecallPoke and FriendRecallPoke methods are not covered by existing unit tests; consider adding tests to validate success and failure paths.
public async Task<(int Code, string Message)> GroupRecallPoke(ulong groupUin, ulong messageSequence, ulong messageTime, ulong tipsSeqId)

Comment on lines +317 to +318
public static Task<(int Code, string Message)> GroupRecallPoke(this BotContext bot, ulong groupUin, ulong messageSequence, ulong messageTime, ulong tipsSeqId)
=> bot.ContextCollection.Business.OperationLogic.GroupRecallPoke(groupUin, messageSequence, messageTime, tipsSeqId);
Copy link

Copilot AI May 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Public API extension methods lack XML documentation comments; consider adding summaries to explain purpose and parameters.

Suggested change
public static Task<(int Code, string Message)> GroupRecallPoke(this BotContext bot, ulong groupUin, ulong messageSequence, ulong messageTime, ulong tipsSeqId)
=> bot.ContextCollection.Business.OperationLogic.GroupRecallPoke(groupUin, messageSequence, messageTime, tipsSeqId);
/// <summary>
/// Recalls a poke message in a group chat.
/// </summary>
/// <param name="bot">The target <see cref="BotContext"/> instance.</param>
/// <param name="groupUin">The unique identifier of the group.</param>
/// <param name="messageSequence">The sequence number of the message to recall.</param>
/// <param name="messageTime">The timestamp of the message to recall.</param>
/// <param name="tipsSeqId">The sequence ID of the tips associated with the poke.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains a tuple with a status code and a message.</returns>
public static Task<(int Code, string Message)> GroupRecallPoke(this BotContext bot, ulong groupUin, ulong messageSequence, ulong messageTime, ulong tipsSeqId)
=> bot.ContextCollection.Business.OperationLogic.GroupRecallPoke(groupUin, messageSequence, messageTime, tipsSeqId);

Copilot uses AI. Check for mistakes.
Copy link
Contributor

@KusaGumina KusaGumina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

建议能加一个鉴权,或者干脆只允许撤回自己的,以防止滥用

@DarkRRb DarkRRb dismissed KusaGumina’s stale review May 20, 2025 03:35

No objection

@DarkRRb DarkRRb merged commit 442cefb into master May 20, 2025
8 checks passed
@DarkRRb DarkRRb deleted the darkrrb/feat/implemented-the-recall-poke branch May 21, 2025 10:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants