@@ -187,8 +187,7 @@ func IrcAfterLoggingIn(ctx *IrcContext, rtm *slack.RTM) error {
187187 }
188188 // replace UIDs with user names
189189 text := ev .Msg .Text
190- // handle multiline messages by replacing newlines
191- text = strings .Replace (text , "\n " , "\u2026 " , - 1 )
190+ // replace UIDs with nicknames
192191 text = rxSlackUser .ReplaceAllStringFunc (text , func (subs string ) string {
193192 uid := subs [2 : len (subs )- 1 ]
194193 user := ctx .GetUserInfo (uid )
@@ -209,12 +208,15 @@ func IrcAfterLoggingIn(ctx *IrcContext, rtm *slack.RTM) error {
209208 // don't print my own messages
210209 continue
211210 }
212- privmsg := fmt .Sprintf (":%v!%v@%v PRIVMSG %v :%v\r \n " ,
213- name , ev .Msg .User , ctx .ServerName ,
214- channame , text ,
215- )
216- log .Print (privmsg )
217- ctx .Conn .Write ([]byte (privmsg ))
211+ // handle multi-line messages
212+ for _ , line := range strings .Split (text , "\n " ) {
213+ privmsg := fmt .Sprintf (":%v!%v@%v PRIVMSG %v :%v\r \n " ,
214+ name , ev .Msg .User , ctx .ServerName ,
215+ channame , line ,
216+ )
217+ log .Print (privmsg )
218+ ctx .Conn .Write ([]byte (privmsg ))
219+ }
218220 msgEv := msg .Data .(* slack.MessageEvent )
219221 // Check if the topic has changed
220222 if msgEv .Topic != ctx .Channels [msgEv .Channel ].Topic {
0 commit comments