diff options
| author | Ruben Beltran del Rio <git@r.bdr.sh> | 2025-02-03 23:18:39 +0100 |
|---|---|---|
| committer | Rubén Beltrán del Río <jj@r.bdr.sh> | 2026-09-29 21:29:09 +0200 |
| commit | d2edcceaa61f52c9a28eecab8e563bfef74bbaad (patch) | |
| tree | 046cd15899950da4db2684f73330ba3733fbc1e3 /hotline/file_path.go | |
| parent | 44b49fbd8dd5e0ac85747139f6a962043da4080a (diff) | |
Allow home uploads
Diffstat (limited to 'hotline/file_path.go')
| -rw-r--r-- | hotline/file_path.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/hotline/file_path.go b/hotline/file_path.go index 6bd538f..33771f1 100644 --- a/hotline/file_path.go +++ b/hotline/file_path.go @@ -100,6 +100,17 @@ func (fp *FilePath) IsUploadDir() bool { return strings.Contains(strings.ToLower(string(fp.Items[fp.Len()-1].Name)), "upload") } +/*STARTFQ*/ +func (fp *FilePath) IsUserDir() bool { + if fp.Len() == 0 { + return false + } + + return strings.HasPrefix(string(fp.Items[0].Name), "~") +} +/*ENDFQ*/ + + func (fp *FilePath) Len() uint16 { return binary.BigEndian.Uint16(fp.ItemCount[:]) } |