From 46ae967b003daeabae426e2840c599719c0d3e58 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 13 Oct 2023 13:08:05 +0100 Subject: [PATCH 1/2] build(deps): bump ubuntu from `33a5cc2` to `ed4a422` (#944) --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 0bd89cb9c7..303f0a09ae 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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/* From 123e3801318812dfb1f96f76ca2129453d923fe6 Mon Sep 17 00:00:00 2001 From: "Craig Edwards (Brain)" Date: Sat, 14 Oct 2023 14:05:29 +0100 Subject: [PATCH 2/2] fix: dont require guild cache to fill member roles in message (#945) --- src/dpp/message.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/dpp/message.cpp b/src/dpp/message.cpp index fba25b7ae4..04f8e30675 100644 --- a/src/dpp/message.cpp +++ b/src/dpp/message.cpp @@ -1053,7 +1053,7 @@ 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) { @@ -1061,14 +1061,14 @@ message& message::fill_from_json(json* d, cache_policy_t cp) { } 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; } @@ -1076,7 +1076,7 @@ message& message::fill_from_json(json* d, cache_policy_t cp) { /* 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; } }