like comment and subscribe

This commit is contained in:
winter 2023-01-01 16:06:25 +09:00
parent b67a3c350e
commit cc8d24d2fd
2 changed files with 17 additions and 12 deletions

View File

@ -38,7 +38,7 @@ CrystalGauntlet.endpoints["/getGJComments21.php"] = ->(body : String): String {
special = rs.read(Int32) special = rs.read(Int32)
users_str << Format.fmt_comment({ comment_str = Format.fmt_comment({
2 => GDBase64.encode(comment), 2 => GDBase64.encode(comment),
3 => user_id, 3 => user_id,
4 => likes, 4 => likes,
@ -47,17 +47,22 @@ CrystalGauntlet.endpoints["/getGJComments21.php"] = ->(body : String): String {
9 => Time.parse(created_at, Format::TIME_FORMAT, Time::Location::UTC), 9 => Time.parse(created_at, Format::TIME_FORMAT, Time::Location::UTC),
6 => id, 6 => id,
10 => percent || 0, 10 => percent || 0,
#12 => "0,0,0", # todo: badge 12 => "0,0,0", # todo: badge
#11 => "0:1", 11 => "0",
#1 => username || "-",
#7 => 1,
#9 => icon_value,
#10 => color1,
#11 => color2,
#14 => icon_type,
#15 => special,
#16 => account_id || udid
}) })
comment_str += ":" + Format.fmt_comment({
1 => username || "-",
7 => 1,
9 => icon_value,
10 => color1,
11 => color2,
14 => icon_type,
15 => special,
16 => account_id || udid
})
users_str << comment_str
end end
end end

View File

@ -71,7 +71,7 @@ module CrystalGauntlet::Format
end end
def fmt_comment(hash) : String def fmt_comment(hash) : String
hash.map_with_index{ |(i, v)| "#{i}~#{fmt_value(v, true, false, true)}" }.join("~") hash.map_with_index{ |(i, v)| "#{i}~#{fmt_value(v, false, false, true)}" }.join("~")
end end
end end