This commit is contained in:
parent
2cf84704da
commit
a206a606f7
12 changed files with 231 additions and 111 deletions
|
|
@ -824,7 +824,7 @@ void RealmController::getLiveRealms(const HttpRequestPtr &,
|
|||
auto dbClient = app().getDbClient();
|
||||
// SECURITY: Do NOT expose stream_key in public API - it allows stream hijacking
|
||||
*dbClient << "SELECT r.name, r.viewer_count, r.viewer_multiplier, r.offline_image_url, r.title_color, "
|
||||
"u.username, u.avatar_url "
|
||||
"u.username, u.avatar_url, u.user_color "
|
||||
"FROM realms r JOIN users u ON r.user_id = u.id "
|
||||
"WHERE r.is_live = true AND r.is_active = true "
|
||||
"ORDER BY (r.viewer_count * COALESCE(r.viewer_multiplier, 1)) DESC"
|
||||
|
|
@ -850,6 +850,7 @@ void RealmController::getLiveRealms(const HttpRequestPtr &,
|
|||
realm["avatarUrl"] = row["avatar_url"].isNull() ? "" : row["avatar_url"].as<std::string>();
|
||||
realm["offlineImageUrl"] = row["offline_image_url"].isNull() ? "" : row["offline_image_url"].as<std::string>();
|
||||
realm["titleColor"] = row["title_color"].isNull() ? "#ffffff" : row["title_color"].as<std::string>();
|
||||
realm["colorCode"] = row["user_color"].isNull() ? "#561D5E" : row["user_color"].as<std::string>();
|
||||
resp.append(realm);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue