Skip to content

Commit eaf72f7

Browse files
committed
fix EventRoomTopicPayload timestamp typo
1 parent ce09c4b commit eaf72f7

File tree

4 files changed

+39
-14
lines changed

4 files changed

+39
-14
lines changed

wechaty-puppet-mock/src/main/kotlin/io/github/wechaty/MockPuppet.kt

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -81,51 +81,62 @@ class MockPuppet(puppetOptions: PuppetOptions) : Puppet(puppetOptions) {
8181
}
8282

8383
override fun ding(data: String?) {
84-
log.info("MockPuppet ding($data?:'')")
84+
log.info("MockPuppet ding(${data ?: ""})")
8585
emit("dong", EventDongPayload(data ?: ""))
8686
}
8787

8888
override fun contactSelfName(name: String): Future<Void> {
89-
TODO("Not yet implemented")
89+
log.info("MockPuppet contactSelfName($name)")
90+
return CompletableFuture.completedFuture(null)
9091
}
9192

9293
override fun contactSelfQRCode(): Future<String> {
93-
TODO("Not yet implemented")
94+
log.info("MockPuppet contactSelfQRCode()")
95+
return CompletableFuture.completedFuture(CHATIE_OFFICIAL_ACCOUNT_QRCODE)
9496
}
9597

9698
override fun contactSelfSignature(signature: String): Future<Void> {
97-
TODO("Not yet implemented")
99+
log.info("MockPuppet contactSelfSignature($signature)")
100+
return CompletableFuture.completedFuture(null)
98101
}
99102

100103
override fun tagContactAdd(tagId: String, contactId: String): Future<Void> {
101-
TODO("Not yet implemented")
104+
log.info("MockPuppet tagContactAdd($tagId,$contactId)")
105+
return CompletableFuture.completedFuture(null)
102106
}
103107

104108
override fun tagContactDelete(tagId: String): Future<Void> {
105-
TODO("Not yet implemented")
109+
log.info("MockPuppet tagContactDelete($tagId)")
110+
return CompletableFuture.completedFuture(null)
106111
}
107112

108113
override fun tagContactList(contactId: String): Future<List<String>> {
109-
TODO("Not yet implemented")
114+
log.info("MockPuppet tagContactList($contactId)")
115+
return CompletableFuture.completedFuture(listOf())
110116
}
111117

112118
override fun tagContactList(): Future<List<String>> {
113-
TODO("Not yet implemented")
119+
log.info("MockPuppet tagContactList()")
120+
return CompletableFuture.completedFuture(listOf())
114121
}
115122

116123
override fun tagContactRemove(tagId: String, contactId: String): Future<Void> {
117-
TODO("Not yet implemented")
124+
log.info("MockPuppet tagContactRemove($tagId,$contactId)")
125+
return CompletableFuture.completedFuture(null)
118126
}
119127

120128
override fun contactAlias(contactId: String): Future<String> {
121-
TODO("Not yet implemented")
129+
log.info("MockPuppet contactAlias($contactId)")
130+
return CompletableFuture.completedFuture("mock alias")
122131
}
123132

124133
override fun contactAlias(contactId: String, alias: String?): Future<Void> {
125-
TODO("Not yet implemented")
134+
log.info("MockPuppet contactAlias($contactId,$alias)")
135+
return CompletableFuture.completedFuture(null)
126136
}
127137

128138
override fun getContactAvatar(contactId: String): Future<FileBox> {
139+
log.info("MockPuppet contactAvatar($contactId)")
129140
TODO("Not yet implemented")
130141
}
131142

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package io.github.wechaty
2+
3+
import io.github.wechaty.filebox.FileBox
4+
5+
/**
6+
* config for mock
7+
* @author renxiaoya
8+
* @date 2020-06-02
9+
**/
10+
const val CHATIE_OFFICIAL_ACCOUNT_QRCODE = "http://weixin.qq.com/r/qymXj7DEO_1ErfTs93y5"
11+
12+
fun qrCodeForChatie(): FileBox {
13+
return FileBox.fromQRCode(CHATIE_OFFICIAL_ACCOUNT_QRCODE)
14+
}

wechaty-puppet/src/main/kotlin/io/github/wechaty/schemas/Event.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,10 @@ data class EventRoomTopicPayload(
7979
var newTopic:String,
8080
var oldTopic:String,
8181
var roomId:String,
82-
var timstamp:Long
82+
var timestamp:Long
8383
) {
8484
override fun toString(): String {
85-
return "EventRoomTopicePayload(changerId='$changerId', newTopic='$newTopic', oldTopic='$oldTopic', roomId='$roomId', timstamp=$timstamp)"
85+
return "EventRoomTopicePayload(changerId='$changerId', newTopic='$newTopic', oldTopic='$oldTopic', roomId='$roomId', timestamp=$timestamp)"
8686
}
8787
}
8888

wechaty/src/main/kotlin/io/github/wechaty/Wechaty.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ class Wechaty private constructor(private var wechatyOptions: WechatyOptions) :
275275

276276
val changer = contactManager.loadSelf(payload.changerId)
277277
changer.ready()
278-
val date = Date(payload.timstamp * 1000)
278+
val date = Date(payload.timestamp * 1000)
279279

280280
emit("room-topic", room, payload.newTopic, payload.oldTopic, changer, date)
281281
room.emit("topic", payload.newTopic, payload.oldTopic, changer, date)

0 commit comments

Comments
 (0)