Twitch SDK (Internal)
chatsendwhispertask.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 
15 #include <map>
16 #include <memory>
17 
18 namespace ttv
19 {
20  namespace chat
21  {
22  class ChatSendWhisperTask;
23  }
24 }
25 
27 {
28 public:
29  struct Result
30  {
31  Result();
32 
34  bool authorized;
35  };
36 
37  typedef std::function<void(ChatSendWhisperTask* source, TTV_ErrorCode ec, const std::shared_ptr<Result>& result)> Callback;
38 
39 public:
40  ChatSendWhisperTask(UserId userId, const std::string& authToken, UserId otherUserId, const std::string& message, const std::string& nonce, Callback callback);
41 
42 protected:
43  virtual const char* GetTaskName() const override { return "ChatSendWhisperTask"; }
44 
45  virtual void FillHttpRequestInfo(HttpRequestInfo& requestInfo) override;
46  virtual void ResponseCallback(uint statusCode, const std::vector<char>& response) override;
47  virtual void OnComplete() override;
48 
49 private:
50  std::shared_ptr<Result> mResult;
54  std::string mMessage;
55  std::string mNonce;
56 };
Definition: chatsendwhispertask.h:26
uint32_t UserId
Definition: coretypes.h:22
virtual const char * GetTaskName() const override
Definition: chatsendwhispertask.h:43
virtual void OnComplete() override
std::string mNonce
Definition: chatsendwhispertask.h:55
uint32_t MessageId
Definition: chattypes.h:26
Definition: httptask.h:19
std::shared_ptr< Result > mResult
Definition: chatsendwhispertask.h:50
JSON (JavaScript Object Notation).
Definition: adsapi.h:16
UserId mUserId
Definition: chatsendwhispertask.h:52
std::string mMessage
Definition: chatsendwhispertask.h:54
ChatSendWhisperTask(UserId userId, const std::string &authToken, UserId otherUserId, const std::string &message, const std::string &nonce, Callback callback)
std::function< void(ChatSendWhisperTask *source, TTV_ErrorCode ec, const std::shared_ptr< Result > &result)> Callback
Definition: chatsendwhispertask.h:37
bool authorized
Definition: chatsendwhispertask.h:34
unsigned int uint
Definition: coretypes.h:18
Definition: chatsendwhispertask.h:29
virtual void ResponseCallback(uint statusCode, const std::vector< char > &response) override
UserId mOtherUserId
Definition: chatsendwhispertask.h:53
MessageId messageId
Definition: chatsendwhispertask.h:33
virtual void FillHttpRequestInfo(HttpRequestInfo &requestInfo) override
Definition: httptask.h:22
Callback mCallback
Definition: chatsendwhispertask.h:51