X-Git-Url: https://git.martlubbers.net/?p=cloogle-irc.git;a=blobdiff_plain;f=cloogleirc.icl;h=980ea11564f9dc61a8511bef04cab7510c2ec5ca;hp=69be8397d64c33130df334a1b2b0ee7b84554614;hb=708f2d439b306fe546e86e1a5a65c4081a1a2677;hpb=93f0540991809d459cfc3061c88fc07d1cfc948c diff --git a/cloogleirc.icl b/cloogleirc.icl index 69be839..980ea11 100644 --- a/cloogleirc.icl +++ b/cloogleirc.icl @@ -173,12 +173,13 @@ Start w | m == "!restart" = (Nothing, w) | m.[0] == '!' # (msgs, w) = realProcess (split " " $ m % (1, size m)) w - = (Just $ map (PRIVMSG recipient) msgs, w) + = (Just $ map reply msgs, w) + | m % (0,4) == "\001PING" = (Just [reply m], w) = (Just [], w) where - recipient = case (\(CSepList [t:_]) -> t.[0]) t of - '#' -> t - _ -> CSepList [user.irc_nick] + reply = case (\(CSepList [t:_]) -> t.[0]) t of + '#' -> PRIVMSG t + _ -> NOTICE user.irc_nick process` _ (PING t mt) w = (Just [PONG t mt], w) process` _ _ w = (Just [], w)