Skip to content

Commit 1b0cfb2

Browse files
committed
Add 'chatRoomInfo' event
1 parent c3fca6a commit 1b0cfb2

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

lib/handlers/friends/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,3 +174,12 @@ The result of attempting to join a chat. If successful, the list of chat members
174174
* SteamID of the user who kicked or banned
175175

176176
Something happened in a chat you are in. For example, if the first argument equals `Steam.EChatMemberStateChange.Kicked`, then someone got kicked.
177+
178+
### 'chatRoomInfo'
179+
* SteamID of the chat
180+
* `EChatInfoType`
181+
182+
In case of `EChatInfoType.InfoUpdate`, there are two extra arguments:
183+
184+
* A bitset of values from `EChatFlags`
185+
* SteamID of the user who initiated the change

lib/handlers/friends/index.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,17 @@ handlers[EMsg.ClientChatMemberInfo] = function(data) {
381381
}
382382
};
383383

384+
handlers[EMsg.ClientChatRoomInfo] = function(data) {
385+
var roomInfo = schema.MsgClientChatRoomInfo.decode(data);
386+
var args = [toClanID(roomInfo.steamIdChat), roomInfo.type];
387+
if (roomInfo.type == Steam.EChatInfoType.InfoUpdate) {
388+
var chatFlags = data.readInt32();
389+
var actedBy = data.readUint64().toString();
390+
args.push(chatFlags, actedBy);
391+
}
392+
this.emit.apply(this, ['chatRoomInfo'].concat(args));
393+
};
394+
384395
handlers[EMsg.ClientChatInvite] = function(data) {
385396
var chatInvite = Steam._processProto(schema.CMsgClientChatInvite.decode(data));
386397
this.emit('chatInvite', toClanID(chatInvite.steam_id_chat), chatInvite.chat_name, chatInvite.steam_id_patron);

0 commit comments

Comments
 (0)