Skip to content

Commit

Permalink
Allow old behavior via API - irc.py
Browse files Browse the repository at this point in the history
Some modules may wish to use it.
  • Loading branch information
Foxlet committed Aug 29, 2015
1 parent eaadebd commit f258577
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions cloudbot/clients/irc.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,17 +140,20 @@ def close(self):
self._transport.close()
self._connected = False

def message(self, target, *messages):
def message(self, target, *messages, newlines=False):
for text in messages:
text = text.replace("\n", "").replace("\r", "")
if newlines == False:
text = text.replace("\n", "").replace("\r", "")
self.cmd("PRIVMSG", target, text)

def action(self, target, text):
text = text.replace("\n", "").replace("\r", "")
def action(self, target, text, newlines=False):
if newlines == False:
text = text.replace("\n", "").replace("\r", "")
self.ctcp(target, "ACTION", text)

def notice(self, target, text):
text = text.replace("\n", "").replace("\r", "")
def notice(self, target, text, newlines=False):
if newlines == False:
text = text.replace("\n", "").replace("\r", "")
self.cmd("NOTICE", target, text)

def set_nick(self, nick):
Expand Down

3 comments on commit f258577

@Red-M
Copy link
Contributor

@Red-M Red-M commented on f258577 Aug 29, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is a good idea at all.

To quote from IRC from gonzo:
"08:18 <+gonzo> sending newlines to message though did not mean sending multiple message it meant executing whatever came after \n as a raw command. If plugins are coded to rely on that I don't think that is good."

@ctian1
Copy link
Contributor

@ctian1 ctian1 commented on f258577 Aug 29, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree with @Red-M

@ctian1
Copy link
Contributor

@ctian1 ctian1 commented on f258577 Aug 29, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't fix .unencode does it?

Please sign in to comment.