This repository has been archived by the owner on Sep 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: social links, doc comments and reactions, event series
- Loading branch information
1 parent
b9e34cd
commit 1d55bdc
Showing
72 changed files
with
1,302 additions
and
308 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package io.github.srgaabriel.deck.core.entity | ||
|
||
import io.github.srgaabriel.deck.common.util.GenericId | ||
import io.github.srgaabriel.deck.core.stateless.StatelessUser | ||
import io.github.srgaabriel.deck.core.stateless.channel.content.StatelessDocumentationComment | ||
import io.github.srgaabriel.deck.core.util.BlankStatelessUser | ||
import kotlinx.datetime.Instant | ||
|
||
/** | ||
* Represents a comment posted in a [Documentation] | ||
*/ | ||
public interface DocumentationComment: StatelessDocumentationComment { | ||
/** The comment's content */ | ||
public val content: String | ||
|
||
/** The id of this comment's author */ | ||
public val authorId: GenericId | ||
public val author: StatelessUser get() = BlankStatelessUser(client, authorId) | ||
|
||
/** The date when this comment was created */ | ||
public val createdAt: Instant | ||
/** The date when this comment was updated, if it was ever updated */ | ||
public val updatedAt: Instant? | ||
|
||
/** The mentions in this comment, null if none */ | ||
public val mentions: Mentions? | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package io.github.srgaabriel.deck.core.entity | ||
|
||
import io.github.srgaabriel.deck.common.entity.RawUserSocialLink | ||
import io.github.srgaabriel.deck.common.entity.SocialLinkType | ||
import io.github.srgaabriel.deck.common.util.GenericId | ||
import io.github.srgaabriel.deck.common.util.asNullable | ||
import io.github.srgaabriel.deck.core.DeckClient | ||
import io.github.srgaabriel.deck.core.stateless.StatelessUser | ||
import io.github.srgaabriel.deck.core.util.BlankStatelessUser | ||
import kotlinx.datetime.Instant | ||
|
||
public data class SocialLink( | ||
val client: DeckClient, | ||
val type: SocialLinkType, | ||
val userId: GenericId, | ||
val handle: String?, | ||
val serviceId: String?, | ||
val createdAt: Instant | ||
) { | ||
val user: StatelessUser get() = BlankStatelessUser(client, userId) | ||
|
||
public companion object { | ||
public fun from(client: DeckClient, raw: RawUserSocialLink): SocialLink = SocialLink( | ||
client = client, | ||
type = raw.type, | ||
userId = raw.userId, | ||
handle = raw.handle.asNullable(), | ||
serviceId = raw.serviceId.asNullable(), | ||
createdAt = raw.createdAt | ||
) | ||
} | ||
} |
Oops, something went wrong.