| 221 | } |
| 222 | |
| 223 | size_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 | } |
no test coverage detected