aboutsummaryrefslogtreecommitdiff
path: root/src/utils/irc.py
diff options
context:
space:
mode:
authorGravatar jesopo2019-02-12 13:55:57 +0000
committerGravatar jesopo2019-02-12 13:55:57 +0000
commit86bc49a0a18c68e962807b7164166b673a978c50 (patch)
tree0a7b34e57e66cbc2504ebc3a293e1e3f76513a51 /src/utils/irc.py
parentChange arg types of constant_time_compare to typing.AnyStr (utils.security) (diff)
signature
Only put a ":" on trailing args when it's required
Diffstat (limited to 'src/utils/irc.py')
-rw-r--r--src/utils/irc.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/utils/irc.py b/src/utils/irc.py
index 78b26d65..59624293 100644
--- a/src/utils/irc.py
+++ b/src/utils/irc.py
@@ -293,3 +293,9 @@ class IRCBatch(object):
self.type = batch_type
self.tags = tags
self.lines = [] # type: typing.List[IRCParsedLine]
+
+def trailing(s: str) -> str:
+ if s[0] == ":" or " " in s:
+ return ":%s" % s
+ else:
+ return s