Skip to content

Commit

Permalink
WebDAV Push: add push-message property
Browse files Browse the repository at this point in the history
  • Loading branch information
rfc2822 committed Jun 16, 2024
1 parent dd49701 commit b8be778
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

# Java/Kotlin files
*.class
kotlin/
.kotlin/

# Generated files
bin/
Expand Down
2 changes: 2 additions & 0 deletions src/main/kotlin/at/bitfire/dav4jvm/PropertyRegistry.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import at.bitfire.dav4jvm.property.carddav.AddressData
import at.bitfire.dav4jvm.property.carddav.AddressbookDescription
import at.bitfire.dav4jvm.property.carddav.AddressbookHomeSet
import at.bitfire.dav4jvm.property.carddav.SupportedAddressData
import at.bitfire.dav4jvm.property.push.PushMessage
import at.bitfire.dav4jvm.property.push.PushSubscribe
import at.bitfire.dav4jvm.property.push.PushTransports
import at.bitfire.dav4jvm.property.push.Subscription
Expand Down Expand Up @@ -84,6 +85,7 @@ object PropertyRegistry {
at.bitfire.dav4jvm.property.caldav.MaxResourceSize.Factory,
at.bitfire.dav4jvm.property.carddav.MaxResourceSize.Factory,
Owner.Factory,
PushMessage.Factory,
PushSubscribe.Factory,
PushTransports.Factory,
QuotaAvailableBytes.Factory,
Expand Down
40 changes: 40 additions & 0 deletions src/main/kotlin/at/bitfire/dav4jvm/property/push/PushMessage.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

package at.bitfire.dav4jvm.property.push

import at.bitfire.dav4jvm.Property
import at.bitfire.dav4jvm.PropertyFactory
import at.bitfire.dav4jvm.XmlUtils
import org.xmlpull.v1.XmlPullParser

/**
* Represents a `{DAV:Push}push-message` property.
*
* Experimental! See https://github.com/bitfireAT/webdav-push/
*/
class PushMessage(
val topic: String?
): Property {

companion object {

@JvmField
val NAME = Property.Name(NS_WEBDAV_PUSH, "push-message")

}


object Factory: PropertyFactory {

override fun getName() = NAME

override fun create(parser: XmlPullParser) =
PushMessage(XmlUtils.readTextProperty(parser, Topic.NAME))

}

}

0 comments on commit b8be778

Please sign in to comment.