Skip to content

Commit

Permalink
Merge branch 'dev' of github.com:brainboxdotcc/DPP
Browse files Browse the repository at this point in the history
  • Loading branch information
braindigitalis committed Oct 14, 2023
2 parents 394acb9 + 123e380 commit f1657d0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:focal@sha256:33a5cc25d22c45900796a1aca487ad7a7cb09f09ea00b779e3b2026b4fc2faba
FROM ubuntu:focal@sha256:ed4a42283d9943135ed87d4ee34e542f7f5ad9ecf2f244870e23122f703f91c2

ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install --no-install-recommends -y libssl-dev zlib1g-dev libsodium-dev libopus-dev cmake pkg-config g++ gcc git make && apt-get clean && rm -rf /var/lib/apt/lists/*
Expand Down
10 changes: 5 additions & 5 deletions src/dpp/message.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1053,30 +1053,30 @@ message& message::fill_from_json(json* d, cache_policy_t cp) {
/* Fill in member record, cache uncached ones */
guild* g = find_guild(this->guild_id);
this->member = {};
if (g && d->find("member") != d->end()) {
if (guild_id && d->find("member") != d->end()) {
json& mi = (*d)["member"];
snowflake uid = snowflake_not_null(&(mi["user"]), "id");
if (!uid && author.id) {
uid = author.id;
}
if (cp.user_policy == dpp::cp_none) {
/* User caching off! Just fill in directly but dont store member to guild */
this->member.fill_from_json(&mi, g->id, uid);
} else {
this->member.fill_from_json(&mi, this->guild_id, uid);
} else if (g) {
/* User caching on, lazy or aggressive - cache the member information */
auto thismember = g->members.find(uid);
if (thismember == g->members.end()) {
if (!uid.empty() && author.id) {
guild_member gm;
gm.fill_from_json(&mi, g->id, uid);
gm.fill_from_json(&mi, this->guild_id, uid);
g->members[author.id] = gm;
this->member = gm;
}
} else {
/* Update roles etc */
this->member = thismember->second;
if (author.id) {
this->member.fill_from_json(&mi, g->id, author.id);
this->member.fill_from_json(&mi, this->guild_id, author.id);
g->members[author.id] = this->member;
}
}
Expand Down

0 comments on commit f1657d0

Please sign in to comment.