]> git.r.bdr.sh - rbdr/mobius/blobdiff - hotline/file_path.go
Allow home uploads
[rbdr/mobius] / hotline / file_path.go
index 620f54d5cd0a5b969ade3237ad57617d65fd370e..bb6bbd312b62864591b893774930d23da5b19227 100644 (file)
@@ -98,11 +98,20 @@ 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[:])
 }
 
-func readPath(fileRoot string, filePath, fileName []byte) (fullPath string, err error) {
+func ReadPath(fileRoot string, filePath, fileName []byte) (fullPath string, err error) {
        var fp FilePath
        if filePath != nil {
                if _, err = fp.Write(filePath); err != nil {