mirror of
https://github.com/icewind1991/mx-puppet-steam.git
synced 2026-06-03 17:44:09 +02:00
keeping track of typing is done by the bridge
This commit is contained in:
parent
bfbd3b7977
commit
c6be6d0a3f
1 changed files with 2 additions and 14 deletions
16
src/steam.ts
16
src/steam.ts
|
|
@ -22,7 +22,6 @@ interface ISteamPuppet {
|
|||
client: SteamUser;
|
||||
data: any;
|
||||
sentEventIds: string[];
|
||||
typingUsers: { [key: string]: any };
|
||||
knownPersonas: Map<string, IPersona>,
|
||||
}
|
||||
|
||||
|
|
@ -152,13 +151,6 @@ export class Steam {
|
|||
public async handleFriendMessage(puppetId: number, message: IIncomingFriendMessage, fromSteamId?: SteamID) {
|
||||
const p = this.puppets[puppetId];
|
||||
log.verbose("Got message from steam to pass on");
|
||||
const typingKey = message.steamid_friend.toString();
|
||||
|
||||
if (p.typingUsers[typingKey]) {
|
||||
// user is typing, stop that
|
||||
await this.bridge.setUserTyping(p.typingUsers[typingKey], false);
|
||||
delete p.typingUsers[typingKey];
|
||||
}
|
||||
|
||||
await this.bridge.sendMessage(await this.getSendParams(puppetId, message, fromSteamId), {
|
||||
body: message.message,
|
||||
|
|
@ -166,10 +158,7 @@ export class Steam {
|
|||
}
|
||||
|
||||
public async handleFriendTyping(puppetId: number, message: IIncomingFriendMessage) {
|
||||
const p = this.puppets[puppetId];
|
||||
const typingKey = message.steamid_friend.toString();
|
||||
|
||||
p.typingUsers[typingKey] = {
|
||||
await this.bridge.setUserTyping({
|
||||
room: {
|
||||
puppetId,
|
||||
roomId: message.steamid_friend.toString(),
|
||||
|
|
@ -178,8 +167,7 @@ export class Steam {
|
|||
puppetId,
|
||||
userId: message.steamid_friend.toString(),
|
||||
},
|
||||
};
|
||||
await this.bridge.setUserTyping(p.typingUsers[typingKey], true);
|
||||
}, true);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue