Skip to content

Commit

Permalink
fixed
Browse files Browse the repository at this point in the history
The error that mediawiki returns while writing to a page that wasn't meant
to exist was not handled properly now it should work
  • Loading branch information
benapetr committed Apr 3, 2014
1 parent 25a96b2 commit 1225992
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 4 additions & 0 deletions huggle/message.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,10 @@ void Message::Finish()
this->Fail("Edit conflict");
Huggle::Syslog::HuggleLogs->DebugLog("EC while delivering message to " + this->user->Username);
this->Error = MessageError_Obsolete;
} else if (ec == "articleexist")
{
this->Fail("Edit conflict");
this->Error = MessageError_ArticleExist;
} else
{
this->Fail("Unknown error: " + ec);
Expand Down
6 changes: 2 additions & 4 deletions huggle/message.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@
#define MESSAGE_H

#include "definitions.hpp"
// now we need to ensure that python is included first, because it
// simply suck :P
// seriously, Python.h is shitty enough that it requires to be
// included first. Don't believe it? See this:
// now we need to ensure that python is included first. Don't believe it? See this:
// http://stackoverflow.com/questions/20300201/why-python-h-of-python-3-2-must-be-included-as-first-together-with-qt4
#ifdef PYTHONENGINE
#include <Python.h>
Expand Down Expand Up @@ -49,6 +46,7 @@ namespace Huggle
MessageError_Dependency,
MessageError_Obsolete,
MessageError_Expired,
MessageError_ArticleExist,
MessageError_Unknown
};

Expand Down
2 changes: 1 addition & 1 deletion huggle/warnings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ void Warnings::ResendWarnings()
warning->RelatedEdit->User->Update();
}
// check if the warning wasn't delivered because someone edited the page
if (warning->Warning->Error == Huggle::MessageError_Obsolete)
if (warning->Warning->Error == Huggle::MessageError_Obsolete || warning->Warning->Error == Huggle::MessageError_ArticleExist)
{
Syslog::HuggleLogs->DebugLog("Someone changed the content of " + warning->Warning->user->Username + " reparsing it now");
// we need to fetch the talk page again and later we need to issue new warning
Expand Down

0 comments on commit 1225992

Please sign in to comment.