Twitch SDK (Internal)
socialtypes.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 
15 
16 namespace ttv
17 {
18  namespace social
19  {
20  struct FeatureFlags
21  {
22  FeatureFlags();
23 
24  static FeatureFlags All();
25  static FeatureFlags None();
26 
27  bool friendList : 1;
28  bool friendRequests : 1;
29  bool presence : 1;
30  };
31 
32 
38  {
39  Offline,
40  Online,
41  Away,
42  Busy
43  };
44 
45 
50  {
51  Offline,
52  Online,
53  Idle
54  };
55 
56 
63  {
65 
66  bool operator==(const PresenceSettings& rhs);
67  bool operator!=(const PresenceSettings& rhs);
68 
73  {
74  None,
75  Offline,
76  Away,
77  Busy
78  };
79 
85 
89  bool shareActivity : 1;
90  };
91 
92 
98  using PresenceActivityToken = uint32_t;
99 
100 
105  {
109  enum class Type
110  {
111  Broadcasting,
112  Watching,
113  Playing,
114  Unknown
115  };
116 
120  virtual Type GetType() const = 0;
121 
125  virtual std::unique_ptr<PresenceActivity> Clone() const = 0;
126  };
127 
128 
132  struct BroadcastingActivity : public Cloneable<PresenceActivity, BroadcastingActivity>
133  {
135 
136  std::string channelLogin;
137  std::string channelDisplayName;
138  std::string gameName;
139 
142 
143  virtual Type GetType() const override
144  {
145  return Type::Broadcasting;
146  }
147  };
148 
149 
153  struct WatchingActivity : public Cloneable<PresenceActivity, WatchingActivity>
154  {
156 
157  std::string channelLogin;
158  std::string channelDisplayName;
159 
160  std::string hostedChannelLogin;
162 
163  std::string gameName;
164 
168 
169  virtual Type GetType() const override
170  {
171  return Type::Watching;
172  }
173  };
174 
175 
179  struct PlayingActivity : public Cloneable<PresenceActivity, PlayingActivity>
180  {
181  PlayingActivity();
182 
183  std::string gameName;
184  std::string gameDisplayContext;
185 
187 
188  virtual Type GetType() const override
189  {
190  return Type::Playing;
191  }
192  };
193 
194 
199  {
200  PresenceStatus();
201  PresenceStatus(const PresenceStatus& source);
202  PresenceStatus& operator=(const PresenceStatus& source);
203 
204  std::unique_ptr<PresenceActivity> activity;
207  };
208 
209 
213  enum class FriendAction
214  {
215  SendRequest,
219  };
220 
221 
226  {
230  RequestSent,
231 
236 
244 
249 
254 
259 
264 
269 
274 
278  Unknown
279  };
280 
281 
283  {
284  Invalid,
285  SelfAccepted,
287  SelfRejected,
289  };
290 
291 
292  enum class FriendStatus
293  {
297  NoRelation,
298 
302  Blocked,
303 
307  Blocks,
308 
312  SentRequest,
313 
318 
322  Friends,
323 
327  Unknown
328  };
329 
330 
334  struct Friend
335  {
336  Friend();
337 
342 
347 
352  };
353 
354 
359  {
360  FriendRequest();
361 
366 
371  };
372  }
373 }
Timestamp requestTime
Definition: socialtypes.h:370
PresenceUserAvailability availability
The offline/online presence of the user.
Definition: socialtypes.h:205
bool friendList
Definition: socialtypes.h:27
Definition: socialtypes.h:20
Definition: socialtypes.h:104
Definition: socialtypes.h:153
ChannelId channelId
The channelId of the channel being viewed.
Definition: socialtypes.h:165
Definition: socialtypes.h:198
FriendAction
Definition: socialtypes.h:213
std::string hostedChannelLogin
The login of a channel that is being hosted by the viewed channel, or empty string if it is not hosti...
Definition: socialtypes.h:160
Definition: coretypes.h:32
std::string gameName
The name of the game being played on the channel.
Definition: socialtypes.h:163
UserInfo userInfo
Definition: socialtypes.h:341
uint32_t GameId
Definition: coretypes.h:24
std::string channelDisplayName
The display name of the channel being viewed.
Definition: socialtypes.h:158
uint32_t Timestamp
Definition: coretypes.h:27
Definition: socialtypes.h:334
FriendRequestRemovalReason
Definition: socialtypes.h:282
Definition: socialtypes.h:62
std::string gameDisplayContext
Some game specific context string that may indicate some extra info about the state of the game being...
Definition: socialtypes.h:184
static FeatureFlags None()
std::string channelLogin
The login of the channel being viewed.
Definition: socialtypes.h:157
JSON (JavaScript Object Notation).
Definition: adsapi.h:16
Timestamp friendsSinceTime
Definition: socialtypes.h:346
Definition: socialtypes.h:358
Definition: socialtypes.h:179
virtual Type GetType() const override
Definition: socialtypes.h:188
Definition: socialtypes.h:132
AvailabilityOverride availabilityOverride
Definition: socialtypes.h:84
std::string channelDisplayName
The display name of the channel the user is broadcasting from.
Definition: socialtypes.h:137
FriendStatus
Definition: socialtypes.h:292
uint32_t PresenceActivityToken
Definition: socialtypes.h:98
PresenceUserAvailability
Definition: socialtypes.h:37
Type
Definition: socialtypes.h:109
ChannelId channelId
The channelId of the channel the user is broadcasting from.
Definition: socialtypes.h:140
PresenceStatus presenceStatus
Definition: socialtypes.h:351
Timestamp lastUpdate
The last time this user&#39;s presence changed.
Definition: socialtypes.h:206
GameId gameId
The ID of the game being played on the channel.
Definition: socialtypes.h:167
Definition: coreutilities.h:49
std::string channelLogin
The login of the channel the user is broadcasting from.
Definition: socialtypes.h:136
GameId gameId
The ID of the game being played on the channel.
Definition: socialtypes.h:141
bool presence
Definition: socialtypes.h:29
PresenceSessionAvailability
Definition: socialtypes.h:49
std::string gameName
The name of the game being played on the channel.
Definition: socialtypes.h:138
std::unique_ptr< PresenceActivity > activity
The activity the user is engaging in, or nullptr if the user is not sharing any activity.
Definition: socialtypes.h:204
static FeatureFlags All()
std::string gameName
The name of the game being played.
Definition: socialtypes.h:183
GameId gameId
The ID of the game being played.
Definition: socialtypes.h:186
uint32_t ChannelId
Definition: coretypes.h:23
std::string hostedChannelDisplayName
The display name of the channel that is being hosted by the viewed channel, or empty string if it is ...
Definition: socialtypes.h:161
ChannelId hostedChannelId
The channelID of the channel being hosted by the viewed channel, or 0 if it is not hosting...
Definition: socialtypes.h:166
UpdateFriendResult
Definition: socialtypes.h:225
bool friendRequests
Definition: socialtypes.h:28
UserInfo userInfo
Definition: socialtypes.h:365
virtual Type GetType() const override
Definition: socialtypes.h:169
virtual Type GetType() const override
Definition: socialtypes.h:143
AvailabilityOverride
Definition: socialtypes.h:72
bool shareActivity
Definition: socialtypes.h:89