ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/FreeBSDAdmin/IRC/trout.cpp
(Generate patch)

Comparing FreeBSDAdmin/IRC/trout.cpp (file contents):
Revision 1266 by douglas, 2010-03-21T19:13:37-07:00 vs.
Revision 1449 by douglas, 2012-12-02T14:05:43-08:00

# Line 4 | Line 4
4   //
5   // $Id$
6  
7 < #include <main.h>
8 < #include <Modules.h>
9 < #include <Chan.h>
10 < #include <Client.h>
11 < #include <User.h>
7 > #include <znc/main.h>
8 > #include <znc/Modules.h>
9 > #include <znc/Chan.h>
10 > #include <znc/Client.h>
11 > #include <znc/IRCNetwork.h>
12  
13   #include "foreach.hpp"
14  
# Line 32 | Line 32 | public:
32                          CString who(message.Token(1));
33  
34                          if (who.empty())
35 <                                if (GetUser()->IsChan(target))
35 >                                if (GetNetwork()->IsChan(target))
36                                  {
37 <                                        typedef std::map<CString, CNick *> NickMap;
37 >                                        typedef std::map<CString, CNick> NickMap;
38  
39                                          VCString nicks;
40  
41 <                                        _foreach (const NickMap, nick, GetUser()->FindChan(target)->GetNicks())
41 >                                        _foreach (const NickMap, nick, GetNetwork()->FindChan(target)->GetNicks())
42                                                  nicks.push_back(nick->first);
43  
44                                          who = nicks[::random() % nicks.size()];
# Line 48 | Line 48 | public:
48  
49                          message = "\001ACTION slaps " + who + " around a bit with a large trout\001";
50  
51 <                        if (GetUser()->IsChan(target))
51 >                        if (GetNetwork()->IsChan(target))
52                                  PutUser(":" + GetClient()->GetNickMask() + " PRIVMSG " + target + " :" + message);
53                          else
54                                  PutUser(":" + target + " NOTICE " + GetClient()->GetNick() + " :\001ACTION \002" + GetClient()->GetNick() + "\017 slaps " + who + " around a bit with a large trout\001");
# Line 58 | Line 58 | public:
58          }
59   };
60  
61 < MODULEDEFS(Trout, "Trout");
61 > MODULEDEFS(Trout, "Slap people around a bit with a large trout");
62 >
63 > // vim: noexpandtab tabstop=4

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines