@@ -187,8 +187,7 @@ func IrcAfterLoggingIn(ctx *IrcContext, rtm *slack.RTM) error {
187
187
}
188
188
// replace UIDs with user names
189
189
text := ev .Msg .Text
190
- // handle multiline messages by replacing newlines
191
- text = strings .Replace (text , "\n " , "\u2026 " , - 1 )
190
+ // replace UIDs with nicknames
192
191
text = rxSlackUser .ReplaceAllStringFunc (text , func (subs string ) string {
193
192
uid := subs [2 : len (subs )- 1 ]
194
193
user := ctx .GetUserInfo (uid )
@@ -209,12 +208,15 @@ func IrcAfterLoggingIn(ctx *IrcContext, rtm *slack.RTM) error {
209
208
// don't print my own messages
210
209
continue
211
210
}
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
+ }
218
220
msgEv := msg .Data .(* slack.MessageEvent )
219
221
// Check if the topic has changed
220
222
if msgEv .Topic != ctx .Channels [msgEv .Channel ].Topic {
0 commit comments