From d34160c512a52cf1f5caf59fa00372d3a627e24c Mon Sep 17 00:00:00 2001 From: Ruben Beltran del Rio Date: Mon, 3 Feb 2025 23:18:39 +0100 Subject: Allow home uploads --- hotline/file_path.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'hotline') diff --git a/hotline/file_path.go b/hotline/file_path.go index f4a27cc..bb6bbd3 100644 --- a/hotline/file_path.go +++ b/hotline/file_path.go @@ -98,6 +98,15 @@ func (fp *FilePath) IsUploadDir() bool { return strings.Contains(strings.ToLower(string(fp.Items[fp.Len()-1].Name)), "upload") } +func (fp *FilePath) IsUserDir() bool { + if fp.Len() == 0 { + return false + } + + return strings.HasPrefix(string(fp.Items[0].Name), "~") +} + + func (fp *FilePath) Len() uint16 { return binary.BigEndian.Uint16(fp.ItemCount[:]) } -- cgit