Skip to content

Commit

Permalink
Merge branch 'master' into greenkeeper/tslint-5.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
huan committed May 4, 2017
2 parents f65d8b3 + 5c23158 commit 742a441
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
4 changes: 2 additions & 2 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "wechaty",
"version": "0.8.5",
"version": "0.8.6",
"description": "Wechat for Bot(Personal Account)",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down Expand Up @@ -148,8 +148,8 @@
"shx": "0.2.2",
"sinon": "2.2.0",
"sloc": "0.2.0",
"ts-node": "3.0.2",
"tslint": "5.2.0",
"tslint": "5.1.0",
"tslint-jsdoc-rules": "0.1.2",
"tuling123-client": "0.0.1",
"typescript": "2.3.2",
Expand Down
10 changes: 9 additions & 1 deletion src/contact.ts
Expand Up @@ -146,7 +146,15 @@ export class Contact implements Sayable {
* const weixin = contact.weixin()
* ```
*/
public weixin() { return this.obj && this.obj.weixin || null }
public weixin(): string | null {
const wxId = this.obj && this.obj.weixin || null
if (!wxId) {
log.info('Contact', `weixin() is not able to always work, it's limited by Tencent API`)
log.silly('Contact', 'weixin() If you want to track a contact between sessions, see FAQ at')
log.silly('Contact', 'https://github.com/Chatie/wechaty/wiki/FAQ#1-how-to-get-the-permanent-id-for-a-contact')
}
return wxId
}

/**
* Get the name from a contact
Expand Down
4 changes: 4 additions & 0 deletions src/room.ts
Expand Up @@ -508,6 +508,10 @@ export class Room extends EventEmitter implements Sayable {

if (!this.obj || !this.obj.memberList || this.obj.memberList.length < 1) {
log.warn('Room', 'memberList() not ready')
log.verbose('Room', 'memberList() trying call refresh() to update')
this.refresh().then(() => {
log.verbose('Room', 'memberList() refresh() done')
})
return []
}
return this.obj.memberList
Expand Down

0 comments on commit 742a441

Please sign in to comment.