Huggle  build:^490^dce1e5c
 All Classes Namespaces Functions Variables Enumerations Enumerator Pages
hooks.cpp
1 //This program is free software: you can redistribute it and/or modify
2 //it under the terms of the GNU General Public License as published by
3 //the Free Software Foundation, either version 3 of the License, or
4 //(at your option) any later version.
5 
6 //This program is distributed in the hope that it will be useful,
7 //but WITHOUT ANY WARRANTY; without even the implied warranty of
8 //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 //GNU General Public License for more details.
10 
11 #include "hooks.hpp"
12 
13 
14 void Huggle::Hooks::EditPreProcess(Huggle::WikiEdit *Edit)
15 {
16  int extension = 0;
17  while (extension < Huggle::iExtension::Extensions.count())
18  {
19  Huggle::iExtension *e = Huggle::iExtension::Extensions.at(extension);
20  if (e->IsWorking())
21  {
22  e->Hook_EditPreProcess((void*)Edit);
23  }
24  extension++;
25  }
26 }
27 
28 void Huggle::Hooks::EditPostProcess(Huggle::WikiEdit *Edit)
29 {
30  int extension = 0;
31  while (extension < Huggle::iExtension::Extensions.count())
32  {
33  Huggle::iExtension *e = Huggle::iExtension::Extensions.at(extension);
34  if (e->IsWorking())
35  {
36  e->Hook_EditPostProcess((void*)Edit);
37  }
38  extension++;
39  }
40 }
41 
42 void Huggle::Hooks::OnGood(Huggle::WikiEdit *Edit)
43 {
44  Core::Main->VandalDock->Good(Edit);
45 }
46 
47 void Huggle::Hooks::OnRevert(Huggle::WikiEdit *Edit)
48 {
50 }
51 
52 void Huggle::Hooks::OnWarning(Huggle::WikiUser *User)
53 {
54  Core::Main->VandalDock->WarningSent(User, User->WarningLevel);
55 }
56 
57 void Huggle::Hooks::Suspicious(Huggle::WikiEdit *Edit)
58 {
59  Core::Main->VandalDock->SuspiciousWikiEdit(Edit);
60 }
61 
62 void Huggle::Hooks::BadnessScore(Huggle::WikiUser *User, int Score)
63 {
64 
65 }
bool IsWorking()
IsWorking.
Definition: iextension.cpp:26
void Rollback(WikiEdit *Edit)
Notify others about a rollback of edit.
Definition: vandalnw.cpp:62
void Good(WikiEdit *Edit)
This will deliver an edit to others as a good edit.
Definition: vandalnw.cpp:57
VandalNw * VandalDock
Pointer to vandal network.
Definition: mainwindow.hpp:148
int WarningLevel
Current warning level of user.
Definition: wikiuser.hpp:54
Extension interface.
Definition: iextension.hpp:29
virtual void Hook_EditPreProcess(void *edit)
Hook_EditPreProcess is called when edit is being pre processed.
Definition: iextension.hpp:49
Wiki edit.
Definition: wikiedit.hpp:67
static MainWindow * Main
Pointer to main.
Definition: core.hpp:111