This repository was archived by the owner on Jun 9, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
src/main/java/com/mewna/catnip/shard Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change 158
158
<groupId >ch.qos.logback</groupId >
159
159
<artifactId >logback-classic</artifactId >
160
160
<version >${logback.version} </version >
161
- <scope >test</scope >
161
+ <!-- <scope>test</scope> -- >
162
162
</dependency >
163
163
164
164
<!-- Deep/recursive field by field comparing ignoring any equals() methods -->
Original file line number Diff line number Diff line change 45
45
import org .apache .commons .lang3 .tuple .ImmutablePair ;
46
46
47
47
import javax .annotation .Nonnull ;
48
+ import java .util .List ;
48
49
import java .util .Optional ;
49
50
50
51
import static com .mewna .catnip .cache .EntityCacheWorker .CachedEntityState .*;
@@ -217,6 +218,11 @@ private void emit0(@Nonnull final JsonObject payload) {
217
218
case Raw .GUILD_MEMBER_UPDATE -> {
218
219
final String guild = data .getString ("guild_id" );
219
220
final PartialMember partialMember = catnip .entityBuilder ().createPartialMember (guild , data );
221
+ // TODO: Figure out firing a user update here
222
+ if (data .has ("user" )) {
223
+ final var user = catnip .entityBuilder ().createUser (data .getObject ("user" ));
224
+ catnip .cacheWorker ().bulkCacheUsers (payload .getObject ("shard" ).getInt ("id" ), List .of (user ));
225
+ }
220
226
if (catnip .cacheWorker ().canProvidePreviousState (MEMBER )) {
221
227
catnip .cache ().member (partialMember .guildIdAsLong (), partialMember .idAsLong ())
222
228
.map (Optional ::of )
You can’t perform that action at this time.
0 commit comments