From 89131df9ab9f37f0f9e50378228a334966a281c4 Mon Sep 17 00:00:00 2001 From: zebrapurring <> Date: Fri, 31 Oct 2025 01:16:42 +0100 Subject: [PATCH] feat: include message sender ID in the message export --- app/chat/export.go | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/app/chat/export.go b/app/chat/export.go index 591695908..e25c16676 100644 --- a/app/chat/export.go +++ b/app/chat/export.go @@ -41,12 +41,13 @@ type ExportOptions struct { } type Message struct { - ID int `json:"id"` - Type string `json:"type"` - File string `json:"file"` - Date int `json:"date,omitempty"` - Text string `json:"text,omitempty"` - Raw *tg.Message `json:"raw,omitempty"` + ID int `json:"id"` + Type string `json:"type"` + File string `json:"file"` + Sender tg.PeerClass `json:"sender,omitempty"` + Date int `json:"date,omitempty"` + Text string `json:"text,omitempty"` + Raw *tg.Message `json:"raw,omitempty"` } // ExportType @@ -197,6 +198,9 @@ loop: File: fileName, } if opts.WithContent { + if fromID, ok := m.GetFromID(); ok { + t.Sender = fromID + } t.Date = m.Date t.Text = m.Message }