Skip to content

Commit a92dd34

Browse files
committed
IRC: Separate SASL password argument from nickserv-pw.
1 parent a9ee2b2 commit a92dd34

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

zulip/integrations/bridge_with_irc/irc-mirror.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
1919
--stream is a Zulip stream.
2020
--topic is a Zulip topic, is optionally specified, defaults to "IRC".
21-
--nickserv-pw is a password for the nickserv, is optionally specified.
21+
Optional arguments:
22+
--nickserv-pw is a password for the nickserv.
23+
--sasl-password is a password for SASL authentication.
2224
2325
Specify your Zulip API credentials and server in a ~/.zuliprc file or using the options.
2426
@@ -36,6 +38,7 @@
3638
parser.add_argument("--stream", default="general")
3739
parser.add_argument("--topic", default="IRC")
3840
parser.add_argument("--nickserv-pw", default="")
41+
parser.add_argument("--sasl-password", default=None)
3942

4043
options = parser.parse_args()
4144
# Setting the client to irc_mirror is critical for this to work
@@ -64,5 +67,6 @@
6467
options.irc_server,
6568
options.nickserv_pw,
6669
options.port,
70+
sasl_password=options.sasl_password,
6771
)
6872
bot.start()

zulip/integrations/bridge_with_irc/irc_mirror_backend.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import logging
22
import multiprocessing as mp
3-
from typing import Any, Dict
3+
from typing import Any, Dict, Optional
44

55
import irc.bot
66
import irc.strings
@@ -20,6 +20,7 @@ def __init__(
2020
server: str,
2121
nickserv_password: str = "",
2222
port: int = 6667,
23+
sasl_password: Optional[str] = None,
2324
) -> None:
2425
self.channel = channel # type: irc.bot.Channel
2526
self.zulip_client = zulip_client
@@ -31,7 +32,7 @@ def __init__(
3132
self.check_subscription_or_die()
3233
# Initialize IRC bot after proper connection to Zulip server has been confirmed.
3334
irc.bot.SingleServerIRCBot.__init__(
34-
self, [(server, port, nickserv_password)], nickname, nickname, sasl_login=nickname
35+
self, [(server, port, sasl_password)], nickname, nickname, sasl_login=nickname
3536
)
3637

3738
def zulip_sender(self, sender_string: str) -> str:

0 commit comments

Comments
 (0)