update to newer version of Matrix SDK
This commit is contained in:
parent
6b579eb856
commit
7d9c09ac9f
@ -10,7 +10,7 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"parent-require": "^1.0.0",
|
"parent-require": "^1.0.0",
|
||||||
"matrix-js-sdk": ">=0.3.0"
|
"matrix-js-sdk": "^0.6.0"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"hubot": ">=2.0"
|
"hubot": ">=2.0"
|
||||||
|
@ -49,9 +49,11 @@ class Matrix extends Adapter
|
|||||||
baseUrl: process.env.HUBOT_MATRIX_HOST_SERVER || 'https://matrix.org'
|
baseUrl: process.env.HUBOT_MATRIX_HOST_SERVER || 'https://matrix.org'
|
||||||
accessToken: @access_token
|
accessToken: @access_token
|
||||||
userId: @user_id
|
userId: @user_id
|
||||||
@client.on 'syncComplete', =>
|
@client.on 'sync', (state, prevState, data) =>
|
||||||
@robot.logger.info "Synced #{@client.getRooms().length} rooms"
|
switch state
|
||||||
@emit 'connected'
|
when "PREPARED"
|
||||||
|
@robot.logger.info "Synced #{@client.getRooms().length} rooms"
|
||||||
|
@emit 'connected'
|
||||||
@client.on 'Room.timeline', (event, room, toStartOfTimeline) =>
|
@client.on 'Room.timeline', (event, room, toStartOfTimeline) =>
|
||||||
if event.getType() == 'm.room.message' and toStartOfTimeline == false
|
if event.getType() == 'm.room.message' and toStartOfTimeline == false
|
||||||
message = event.getContent().body
|
message = event.getContent().body
|
||||||
|
Loading…
Reference in New Issue
Block a user