This repository was archived by the owner on Jun 30, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -26,12 +26,12 @@ def run
2626 end
2727
2828 def send_messages ( target , strings )
29- if target . room
30- channel = Cinch ::Channel . new ( target . room , cinch )
31- strings . each { |s | channel . msg ( s ) }
32- else
29+ if target . private_message?
3330 user = Cinch ::User . new ( target . user . name , cinch )
3431 strings . each { |s | user . msg ( s ) }
32+ else
33+ channel = Cinch ::Channel . new ( target . room , cinch )
34+ strings . each { |s | channel . msg ( s ) }
3535 end
3636 end
3737
Original file line number Diff line number Diff line change 5959
6060 describe "#send_messages" do
6161 it "sends messages to rooms" do
62- source = double ( "Lita::Source" , room : "#foo" )
62+ source = double ( "Lita::Source" , room : "#foo" , private_message? : false )
6363 channel = double ( "Cinch::Channel" )
6464 allow ( Cinch ::Channel ) . to receive ( :new ) . with (
6565 "#foo" ,
7272
7373 it "sends messages to users" do
7474 user = double ( "Lita::User" , name : "Carl" )
75- source = double ( "Lita::Source" , room : nil , user : user )
75+ source = double ( "Lita::Source" , user : user , private_message? : true )
7676 user = double ( "Cinch::User" )
7777 allow ( Cinch ::User ) . to receive ( :new ) . with (
7878 "Carl" ,
You can’t perform that action at this time.
0 commit comments