From f7e46d5033660d12371e68e8e41586573086d156 Mon Sep 17 00:00:00 2001 From: Bohdan Horbeshko Date: Fri, 4 Feb 2022 10:41:55 -0500 Subject: [PATCH] Use UniqueId for file URLs --- telegram/handlers.go | 2 +- telegram/utils.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/telegram/handlers.go b/telegram/handlers.go index f2d580f..5e01520 100644 --- a/telegram/handlers.go +++ b/telegram/handlers.go @@ -263,7 +263,7 @@ func (c *Client) updateFile(update *client.UpdateFile) { err := os.Symlink( update.File.Local.Path, - c.formatFilePath(c.content.Path, update.File.Remote.Id, filepath.Ext(update.File.Local.Path)), + c.formatFilePath(c.content.Path, update.File.Remote.UniqueId, filepath.Ext(update.File.Local.Path)), ) if err != nil { linkErr := err.(*os.LinkError) diff --git a/telegram/utils.go b/telegram/utils.go index 9b0ccba..ffa50b4 100644 --- a/telegram/utils.go +++ b/telegram/utils.go @@ -344,7 +344,7 @@ func (c *Client) formatContent(file *client.File, filename string) string { "%s (%v kbytes) | %s", filename, file.Size/1024, - c.formatFilePath(c.content.Link, file.Remote.Id, filepath.Ext(file.Local.Path)), + c.formatFilePath(c.content.Link, file.Remote.UniqueId, filepath.Ext(file.Local.Path)), ) }