Skip to content

Commit

Permalink
use owncloud namespace for lock details
Browse files Browse the repository at this point in the history
Co-authored-by: Jörn Friedrich Dreyer <[email protected]>
  • Loading branch information
kobergj and butonic committed Aug 24, 2023
1 parent cd206e6 commit e9485c9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions internal/http/services/owncloud/ocdav/locks.go
Original file line number Diff line number Diff line change
Expand Up @@ -580,10 +580,10 @@ func writeLockInfo(w io.Writer, token string, ld LockDetails) (int, error) {
lockdiscovery.WriteString(fmt.Sprintf(" <d:lockroot><d:href>%s</d:href></d:lockroot>\n", prop.Escape(href)))
}
if ld.OwnerName != "" {
lockdiscovery.WriteString(fmt.Sprintf(" <d:ownername>%s</d:ownername>\n", prop.Escape(ld.OwnerName)))
lockdiscovery.WriteString(fmt.Sprintf(" <oc:ownername>%s</oc:ownername>\n", prop.Escape(ld.OwnerName)))
}
if !ld.Locktime.IsZero() {
lockdiscovery.WriteString(fmt.Sprintf(" <d:locktime>%s</d:locktime>\n", prop.Escape(ld.Locktime.Format(time.RFC3339))))
lockdiscovery.WriteString(fmt.Sprintf(" <oc:locktime>%s</oc:locktime>\n", prop.Escape(ld.Locktime.Format(time.RFC3339))))
}

lockdiscovery.WriteString("</d:activelock></d:lockdiscovery></d:prop>")
Expand Down
8 changes: 4 additions & 4 deletions internal/http/services/owncloud/ocdav/propfind/propfind.go
Original file line number Diff line number Diff line change
Expand Up @@ -1637,14 +1637,14 @@ func activeLocks(log *zerolog.Logger, lock *provider.Lock) string {
}

if un := utils.ReadPlainFromOpaque(lock.Opaque, "lockownername"); un != "" {
activelocks.WriteString("<d:ownername>")
activelocks.WriteString("<oc:ownername>")
activelocks.WriteString(un)
activelocks.WriteString("</d:ownername>")
activelocks.WriteString("</oc:ownername>")
}
if lt := utils.ReadPlainFromOpaque(lock.Opaque, "locktime"); lt != "" {
activelocks.WriteString("<d:locktime>")
activelocks.WriteString("<oc:locktime>")
activelocks.WriteString(lt)
activelocks.WriteString("</d:locktime>")
activelocks.WriteString("</oc:locktime>")
}
activelocks.WriteString("<d:timeout>")
activelocks.WriteString(expiration)
Expand Down

0 comments on commit e9485c9

Please sign in to comment.