Skip to content

Commit

Permalink
support presence.status, use yarn v3
Browse files Browse the repository at this point in the history
  • Loading branch information
kabiroberai committed Nov 16, 2021
1 parent 1b51a25 commit e3dad8f
Show file tree
Hide file tree
Showing 6 changed files with 7,240 additions and 4,462 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,11 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*

.yarn/*
!.yarn/patches
!.yarn/releases
!.yarn/plugins
!.yarn/sdks
!.yarn/versions

.vscode
768 changes: 768 additions & 0 deletions .yarn/releases/yarn-3.1.0.cjs

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
enableGlobalCache: true

nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-3.1.0.cjs
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{
"name": "@textshq/platform-slack",
"version": "0.1.0",
"main": "dist/index.js",
"main": "./dist/index.js",
"files": [
"dist/**/*"
],
"scripts": {
"prepack": "patch-package && tsc",
"postinstall": "patch-package && tsc",
Expand All @@ -18,7 +21,7 @@
"@slack/logger": "^3.0.0",
"@slack/rtm-api": "^6.0.0",
"@slack/web-api": "^6.3.0",
"@textshq/platform-sdk": "link:../platform-sdk",
"@textshq/platform-sdk": "https://github.com/TextsHQ/platform-sdk#main",
"bluebird": "^3.7.2",
"eventemitter3": "^3.1.0",
"finity": "^0.5.4",
Expand All @@ -45,5 +48,6 @@
"husky": "^4.3.0",
"jest": "^27.0.6",
"typescript": "^4.3.5"
}
},
"packageManager": "[email protected]"
}
4 changes: 3 additions & 1 deletion src/lib/real-time.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,14 @@ export default class SlackRealTime {

this.rtm.on('presence_change', slackEvent => {
const { user, presence } = slackEvent
const isActive = presence === 'active'

this.onEvent([{
type: ServerEventType.USER_PRESENCE_UPDATED,
presence: {
userID: user,
isActive: presence === 'active',
isActive,
status: isActive ? 'online' : 'offline',
lastActive: undefined,
},
}])
Expand Down
Loading

0 comments on commit e3dad8f

Please sign in to comment.