Twitch SDK (Internal)
chatchangeuserblocktask.h
Go to the documentation of this file.
1 /********************************************************************************************
2 * Twitch Broadcasting SDK
3 *
4 * This software is supplied under the terms of a license agreement with Twitch Interactive, Inc. and
5 * may not be copied or used except in accordance with the terms of that agreement
6 * Copyright (c) 2012-2016 Twitch Interactive, Inc.
7 *********************************************************************************************/
8 
9 #pragma once
10 
14 #include <map>
15 
16 namespace ttv
17 {
18  namespace chat
19  {
20  class ChatChangeUserBlockTask;
21  }
22 }
23 
25 {
26 public:
27  typedef std::function<void(ChatChangeUserBlockTask* source, TTV_ErrorCode result, UserId userId, UserId blockUserId, bool block)> Callback;
28 
29 public:
30  ChatChangeUserBlockTask(UserId userId, const std::string& authToken, UserId blockUserId, bool block, const std::string& reason, Callback callback);
31 
32  void SetWhisper(bool whisper) { mWhisper = whisper; }
33 
34 protected:
35  virtual const char* GetTaskName() const override { return "ChatChangeUserBlockTask"; }
36 
37  virtual void FillHttpRequestInfo(HttpRequestInfo& requestInfo) override;
38  virtual void OnComplete() override;
39 
40 private:
41  Callback mCallback;
42  std::string mReason;
45  bool mBlock;
46  bool mWhisper;
47 };
uint32_t UserId
Definition: coretypes.h:22
void SetWhisper(bool whisper)
Definition: chatchangeuserblocktask.h:32
virtual void FillHttpRequestInfo(HttpRequestInfo &requestInfo) override
bool mWhisper
Definition: chatchangeuserblocktask.h:46
UserId mBlockUserId
Definition: chatchangeuserblocktask.h:44
virtual const char * GetTaskName() const override
Definition: chatchangeuserblocktask.h:35
Definition: httptask.h:19
JSON (JavaScript Object Notation).
Definition: adsapi.h:16
ChatChangeUserBlockTask(UserId userId, const std::string &authToken, UserId blockUserId, bool block, const std::string &reason, Callback callback)
Definition: chatchangeuserblocktask.h:24
std::string mReason
Definition: chatchangeuserblocktask.h:42
UserId mUserId
Definition: chatchangeuserblocktask.h:43
virtual void OnComplete() override
std::function< void(ChatChangeUserBlockTask *source, TTV_ErrorCode result, UserId userId, UserId blockUserId, bool block)> Callback
Definition: chatchangeuserblocktask.h:27
Callback mCallback
Definition: chatchangeuserblocktask.h:41
Definition: httptask.h:22
bool mBlock
Definition: chatchangeuserblocktask.h:45