File tree 2 files changed +11
-1
lines changed
main/scala/wechaty/plugins
test/scala/wechaty/plugins
2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,9 @@ class RoomJoinHello(config:RoomJoinHelloConfig) extends WechatyPlugin with LazyL
17
17
val rooms = PluginHelper .findRooms(config.rooms)
18
18
rooms.foreach(room=> {
19
19
room.onJoin{case (list,_,_)=>
20
- room.say(config.hello,list)
20
+ if (list== null || list.isEmpty ){
21
+ logger.warn(" invitee list is empty" )
22
+ }else room.say(config.hello,list)
21
23
}
22
24
})
23
25
logger.info(" install RoomJoinHello Plugin done" )
Original file line number Diff line number Diff line change @@ -25,6 +25,14 @@ class RoomJoinHelloTest extends TestBase{
25
25
mockContactPayload(" jcai" )
26
26
val payload = new EventRoomJoinPayload
27
27
payload.roomId= " roomId"
28
+ payload.inviteeIdList= Array ()
29
+ instance.puppet.emit(PuppetEventName .ROOM_JOIN ,payload)
30
+
31
+ verifyThat(
32
+ calledMethod(PuppetGrpc .getMessageSendTextMethod),
33
+ times(0 ));
34
+
35
+
28
36
payload.inviteeIdList= Array (" jcai" )
29
37
instance.puppet.emit(PuppetEventName .ROOM_JOIN ,payload)
30
38
You can’t perform that action at this time.
0 commit comments