Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
rwth-unichat
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Linus
rwth-unichat
Merge requests
!2
Changed return-type to JsonArray
Code
Review changes
Check out branch
Download
Patches
Plain diff
Closed
Changed return-type to JsonArray
Gooorgy:master
into
master
Overview
1
Commits
2
Pipelines
0
Changes
1
Closed
Linus
requested to merge
Gooorgy:master
into
master
7 years ago
Overview
1
Commits
2
Pipelines
0
Changes
1
Expand
Created by: Gooorgy
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
d0d0060b
2 commits,
6 years ago
1 file
+
7
−
4
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
src/main/java/me/glatteis/unichat/chat/ChatRoom.kt
+
7
−
4
Options
package
me.glatteis.unichat.chat
import
com.google.gson.JsonArray
import
com.google.gson.JsonObject
import
me.glatteis.unichat.*
import
me.glatteis.unichat.data.Room
import
org.eclipse.jetty.util.ConcurrentHashSet
import
java.io.StringReader
import
java.util.*
import
java.util.concurrent.ConcurrentHashMap
import
kotlin.concurrent.schedule
@@ -113,14 +115,15 @@ class ChatRoom(val id: String, val room: Room) {
/**
* Return online users as json, for unichat.kt
*/
fun
onlineUsersAsJson
():
String
{
return
gson
.
to
Json
(
onlineUsers
.
map
{
fun
onlineUsersAsJson
():
JsonArray
{
return
gson
.
from
Json
(
StringReader
(
onlineUsers
.
map
{
JsonObject
().
apply
{
addProperty
(
"username"
,
it
.
username
)
addProperty
(
"user-id"
,
it
.
publicId
)
}
}
}.
toString
()),
JsonArray
::
class
.
java
)
}
}
\ No newline at end of file
Loading