MCPcopy Create free account
hub / github.com/ZDoom/Raze / JsonWriteJoinReply

Function JsonWriteJoinReply

libraries/discordrpc/src/serialization.cpp:223–250  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

221}
222
223size_t JsonWriteJoinReply(char* dest, size_t maxLen, const char* userId, int reply, int nonce)
224{
225 JsonWriter writer(dest, maxLen);
226
227 {
228 WriteObject obj(writer);
229
230 WriteKey(writer, "cmd");
231 if (reply == DISCORD_REPLY_YES) {
232 writer.String("SEND_ACTIVITY_JOIN_INVITE");
233 }
234 else {
235 writer.String("CLOSE_ACTIVITY_JOIN_REQUEST");
236 }
237
238 WriteKey(writer, "args");
239 {
240 WriteObject args(writer);
241
242 WriteKey(writer, "user_id");
243 writer.String(userId);
244 }
245
246 JsonWriteNonce(writer, nonce);
247 }
248
249 return writer.Size();
250}

Callers 1

Discord_RespondFunction · 0.85

Calls 4

WriteKeyFunction · 0.85
JsonWriteNonceFunction · 0.85
StringMethod · 0.80
SizeMethod · 0.45

Tested by

no test coverage detected