Stargazers name glow yellow

This commit is contained in:
Jeremy Zhang 2017-12-08 01:43:01 +00:00
parent 80468f71f0
commit 5a51f73f74
3 changed files with 11 additions and 1 deletions

View File

@ -1,5 +1,5 @@
from titanembeds.utils import socketio, guild_accepts_visitors, get_client_ipaddr, discord_api, check_user_in_guild, get_guild_channels, update_user_status, guild_webhooks_enabled
from titanembeds.database import db, GuildMembers, get_guild_member, Guilds
from titanembeds.database import db, GuildMembers, get_guild_member, Guilds, get_badges
from flask_socketio import Namespace, emit, disconnect, join_room, leave_room
import functools
from flask import request, session
@ -153,6 +153,7 @@ class Gateway(Namespace):
"avatar": None,
"color": None,
"avatar_url": None,
"stargazer": False,
}
member = db.session.query(GuildMembers).filter(GuildMembers.guild_id == guild_id, GuildMembers.username == name, GuildMembers.discriminator == discriminator).first()
if member:
@ -163,6 +164,7 @@ class Gateway(Namespace):
usr["color"] = self.get_user_color(guild_id, usr["id"])
if (usr["avatar"]):
usr["avatar_url"] = "https://cdn.discordapp.com/avatars/{}/{}.jpg".format(usr["id"], usr["avatar"])
usr["stargazer"] = "star" in get_badges(member.user_id)
else:
member = db.session.query(GuildMembers).filter(GuildMembers.guild_id == guild_id, GuildMembers.nickname == name, GuildMembers.discriminator == discriminator).first()
if member:
@ -173,5 +175,6 @@ class Gateway(Namespace):
usr["color"] = self.get_user_color(guild_id, usr["id"])
if (usr["avatar"]):
usr["avatar_url"] = "https://cdn.discordapp.com/avatars/{}/{}.jpg".format(usr["id"], usr["avatar"])
usr["stargazer"] = "star" in get_badges(member.user_id)
emit("lookup_user_info", usr)
self.teardown_db_session()

View File

@ -205,6 +205,10 @@ nav .brand-logo {
cursor: pointer;
}
#chatcontent .chatusername.stargazer {
text-shadow: 2px 2px 10px yellow;
}
/*#chatcontent > p > span {*/
/* display: table-row*/
/*}*/

View File

@ -1163,6 +1163,9 @@
} else {
parent.find(".chatusername").css("color", null);
}
if (usr.stargazer) {
parent.find(".chatusername").addClass("stargazer");
}
if (usr.avatar_url) {
parent.attr("discord_userid", usr.id);
parent.find(".authoravatar").prop("src", usr.avatar_url);