So here's the deal:
I've been working on getting Phabricator to run on our server.
We got it started pretty easily (thanks guys!) and we wanted to setup an IRC bot,
since it is a communication channel we use a lot in our project.
A colleague of mine set out to get the bot working, but he stumbled upon a problem:
our IRC channel requires a password to be joined to. Since we could not find anything on the documentation that talked about
joining channels that required password, we thought the default behavior would be similar to weechat's config: the name of the
channel followed by a space and then the channel password. You can see what I'm are talking about below:
{ "server" : "irc.freenode.net", "port" : 6667, "nick" : "phabot", "join" : [ "<channel> <password>" ], "handlers" : [ "PhabricatorBotWhatsNewHandler" ], "conduit.uri" : null, "conduit.user" : null, "conduit.cert" : null, "macro.size" : 48, "macro.aspect" : 0.66, "notification.channels" : ["<channel>"] }
This worked for simply joining our channel.
The problem is the way messages are sent to a channel: it uses the channel name it extracts from that 'join' list.
So in our case it considers "<channel> <password>" the actual name of the channel.
This caused us to get Phabot spitting out the channel's password at the beginning of every message it sent.
So we identified the code used by the bot to send messages in src/infrastructure/daemon/bot/handler/PhabricatorBotFeedNotificationHandler.php. We altered the way the $channel_name variable receives its value
so we trim off the password portion and we got it working for our use case.
We believe that joining channels with password is a missing feature, and we'd like to help you guys implement it (if you agree, of course).
What we have right now is probably more of a hack than a proper solution )-:
What do you guys think?
PS: I'm not sure if I selected the correct project when creating this Task. Please feel free to correct me.