Emojis, Markdown and better file uploading

This commit is contained in:
2025-06-06 17:32:48 +10:00
parent 7eba84b6ec
commit 82d18ac74d
3 changed files with 241 additions and 17 deletions

View File

@@ -798,6 +798,20 @@ fun main(args: Array<String>) {
Files.copy(uploadedFile.content(), filePath)
val room = if (ctx.formParam("room") != null) ctx.formParam("room") else "general"
var username: String = ""
var token: String = ""
if (ctx.formParam("username") != null) {
username = ctx.formParam("username").toString()
} else {
// do error
}
if (ctx.formParam("token") != null) {
token = ctx.formParam("token").toString()
} else {
// do error
}
val processedData = JSONObject().apply {
put("type", "fileStatus")
@@ -808,7 +822,7 @@ fun main(args: Array<String>) {
val processedData2 = JSONObject().apply {
put("type", "file")
put("username", "system")
put("username", username)
put("room", room)
put("content", "https://maxwellj.xyz/chookchat/uploads/$newFilename")
}