forked from chookspace/chookchat
Emojis, Markdown and better file uploading
This commit is contained in:
@@ -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")
|
||||
}
|
||||
|
Reference in New Issue
Block a user