mirror of
https://github.com/tiennm99/goclaw.git
synced 2026-10-13 12:14:40 +00:00
fix(pairing): pass senderID to approve callback for group pairings
This commit is contained in:
1 parent
f62f60b094
commit
1f8bcbb559
1 file changed
+4
-3
@@ -11,8 +11,9 @@ import (
|
||||
)
|
||||
|
||||
// PairingApproveCallback is called after a pairing is approved.
|
||||
// channel is the channel name (e.g., "telegram"), chatID is the chat to notify.
|
||||
type PairingApproveCallback func(ctx context.Context, channel, chatID string)
|
||||
// channel is the channel name (e.g., "telegram"), chatID is the chat to notify,
|
||||
// senderID identifies the paired entity (e.g., "group:XXXX" for group pairings).
|
||||
type PairingApproveCallback func(ctx context.Context, channel, chatID, senderID string)
|
||||
|
||||
// PairingMethods handles device.pair.request, device.pair.approve, device.pair.list, device.pair.revoke.
|
||||
type PairingMethods struct {
|
||||
@@ -102,7 +103,7 @@ func (m *PairingMethods) handleApprove(ctx context.Context, client *gateway.Clie
|
||||
// Notify the user via channel (matching TS notifyPairingApproved).
|
||||
// Use Background context: the CLI client may disconnect before the notification is sent.
|
||||
if m.onApprove != nil && paired != nil {
|
||||
go m.onApprove(context.Background(), paired.Channel, paired.ChatID)
|
||||
go m.onApprove(context.Background(), paired.Channel, paired.ChatID, paired.SenderID)
|
||||
}
|
||||
|
||||
if m.broadcaster != nil {
|
||||
|
||||
Reference in new issue
Block a user