Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
briar
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Julian Dehm
briar
Commits
5cf68fa1
Verified
Commit
5cf68fa1
authored
6 years ago
by
akwizgran
Committed by
Torsten Grote
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Use JsonDict for blog post headers.
parent
61c9c6b8
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
briar-headless/src/main/java/org/briarproject/briar/headless/blogs/OutputBlogPost.kt
+17
-12
17 additions, 12 deletions
...a/org/briarproject/briar/headless/blogs/OutputBlogPost.kt
with
17 additions
and
12 deletions
briar-headless/src/main/java/org/briarproject/briar/headless/blogs/OutputBlogPost.kt
+
17
−
12
View file @
5cf68fa1
package
org.briarproject.briar.headless.blogs
package
org.briarproject.briar.headless.blogs
import
org.briarproject.bramble.api.sync.MessageId
import
org.briarproject.bramble.identity.output
import
org.briarproject.bramble.identity.output
import
org.briarproject.briar.api.blog.BlogPostHeader
import
org.briarproject.briar.api.blog.BlogPostHeader
import
org.briarproject.briar.api.blog.MessageType
import
org.briarproject.briar.api.blog.MessageType
import
org.briarproject.briar.headless.json.JsonDict
internal
fun
BlogPostHeader
.
output
(
body
:
String
)
=
mapOf
(
internal
fun
BlogPostHeader
.
output
(
body
:
String
):
JsonDict
{
"body"
to
body
,
val
dict
=
JsonDict
(
"author"
to
author
.
output
(),
"body"
to
body
,
"authorStatus"
to
authorStatus
.
output
(),
"author"
to
author
.
output
(),
"type"
to
type
.
output
(),
"authorStatus"
to
authorStatus
.
output
(),
"id"
to
id
.
bytes
,
"type"
to
type
.
output
(),
"parentId"
to
parentId
?.
bytes
,
"id"
to
id
.
bytes
,
"read"
to
isRead
,
"read"
to
isRead
,
"rssFeed"
to
isRssFeed
,
"rssFeed"
to
isRssFeed
,
"timestamp"
to
timestamp
,
"timestamp"
to
timestamp
,
"timestampReceived"
to
timeReceived
"timestampReceived"
to
timeReceived
)
)
if
(
parentId
!=
null
)
dict
.
put
(
"parentId"
,
(
parentId
as
MessageId
).
bytes
)
return
dict
}
internal
fun
MessageType
.
output
()
=
name
.
toLowerCase
()
internal
fun
MessageType
.
output
()
=
name
.
toLowerCase
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment