Huggle  build:^490^dce1e5c
 All Classes Namespaces Functions Variables Enumerations Enumerator Pages
Huggle::WikiUser Class Reference

User. More...

#include <wikiuser.hpp>

Public Member Functions

 WikiUser (WikiUser *u)
 
 WikiUser (const WikiUser &u)
 
 WikiUser (QString user)
 
QString Flags ()
 Flags. More...
 
void ForceIP ()
 Change the IP property to true forcefully even if user isn't IP.
 
long getBadnessScore (bool _resync=true)
 Retrieve a badness score for current user, see WikiUser::BadnessScore for more.
 
bool GetBot () const
 
QString GetContentsOfTalkPage ()
 GetContentsOfTalkPage returns a precached content of this users talk page If there is a global instance of this user, the talk page is retrieved from it so that in case there are multiple instances of this user, they all share same cached talk page. More...
 
QString GetTalk ()
 Return a link to talk page of this user (like User talk:Jimbo)
 
bool IsIP ()
 Returns true in case the current user is IP user.
 
bool IsWhitelisted ()
 Returns true if this user is wl.
 
void Resync ()
 Update the information of this user based on global user list. More...
 
void setBadnessScore (long value)
 
void SetBot (bool value)
 
void SetContentsOfTalkPage (QString text)
 SetContentsOfTalkPage Change a cache for talk page in local and global cache. More...
 
void Update (bool MatchingOnly=false)
 Call UpdateUser on current user.
 

Static Public Member Functions

static WikiUserRetrieveUser (WikiUser *user)
 Function that return static version of this user. More...
 
static void TrimProblematicUsersList ()
 Delete all users that have badness score 0 these users aren't necessary to be stored in a list.
 
static void UpdateUser (WikiUser *us)
 Update a list of problematic users.
 

Public Attributes

QList< WikiEdit * > Contributions
 Cache of contributions made by this user.
 
bool IsReported
 
QString Username
 Username.
 
int WarningLevel
 Current warning level of user.
 

Static Public Attributes

static QMutex ProblematicUserListLock
 
static QList< WikiUser * > ProblematicUsers
 List of users that are scored in this instance of huggle. More...
 

Private Attributes

long BadnessScore
 Badness score of current user. More...
 
bool Bot
 
QString ContentsOfTalkPage
 In case that we retrieved the talk page during parse of warning level, this string contains it.
 
bool IP
 
QMutex * UserLock
 
int WhitelistInfo
 

Static Private Attributes

static QRegExp IPv4Regex
 Matches only IPv4.
 
static QRegExp IPv6Regex
 Matches all IP.
 

Detailed Description

User.

Definition at line 27 of file wikiuser.hpp.

Member Function Documentation

QString WikiUser::Flags ( )

Flags.

w - is warned r - is reported T- has talkpage R - is registered E - exception

Definition at line 286 of file wikiuser.cpp.

References GetContentsOfTalkPage(), IsIP(), IsReported, and IsWhitelisted().

QString WikiUser::GetContentsOfTalkPage ( )

GetContentsOfTalkPage returns a precached content of this users talk page If there is a global instance of this user, the talk page is retrieved from it so that in case there are multiple instances of this user, they all share same cached talk page.

Because this function needs to obtain the user from global cache it may be slow, in case you need to use its value multiple times, cache it as QString instead of calling this function repeatedly

Returns
a precached content of this users talk page

Definition at line 191 of file wikiuser.cpp.

References ContentsOfTalkPage, and RetrieveUser().

Referenced by Flags(), Resync(), and Huggle::MainWindow::Welcome().

void WikiUser::Resync ( )

Update the information of this user based on global user list.

This is useful when you created user in past and since then a global user has changed so that you just call this to refresh all the scores and information or stuff

Definition at line 174 of file wikiuser.cpp.

References BadnessScore, ContentsOfTalkPage, GetContentsOfTalkPage(), RetrieveUser(), and WarningLevel.

Referenced by getBadnessScore(), Huggle::MainWindow::ProcessEdit(), Huggle::MainWindow::Revert(), Huggle::MainWindow::Warn(), and Huggle::MainWindow::Welcome().

WikiUser * WikiUser::RetrieveUser ( WikiUser user)
static

Function that return static version of this user.

In case the user in question is already in list of problematic users, this function will return its instance. It compares the username against the usernames that are in this list.

Parameters
user
Returns
static user from list of problematic users

Definition at line 22 of file wikiuser.cpp.

References ProblematicUsers, and Username.

Referenced by GetContentsOfTalkPage(), Resync(), and Update().

void WikiUser::SetContentsOfTalkPage ( QString  text)

SetContentsOfTalkPage Change a cache for talk page in local and global cache.

Parameters
textNew content of talk page

Definition at line 212 of file wikiuser.cpp.

References ContentsOfTalkPage, and Update().

Referenced by Huggle::WikiEdit::FinalizePostProcessing(), and Huggle::MainWindow::Welcome().

Member Data Documentation

long Huggle::WikiUser::BadnessScore
private

Badness score of current user.

This score change the badness score of edit, score can be positive (bad) as well as negative in case you want to change the score, don't forget to call WikiUser::UpdateUser(WikiUser *user)

Definition at line 120 of file wikiuser.hpp.

Referenced by getBadnessScore(), Resync(), and UpdateUser().

bool Huggle::WikiUser::IsReported

Local cache that holds information if user is reported or not. This information may be wrong, don't relly on it

Definition at line 74 of file wikiuser.hpp.

Referenced by Huggle::MainWindow::_ReportUser(), Flags(), Huggle::ReportUser::Test(), Huggle::ReportUser::Tick(), UpdateUser(), and Huggle::MainWindow::Warn().

QList< WikiUser * > WikiUser::ProblematicUsers
static

List of users that are scored in this instance of huggle.

Either vandals or even good users, this list is preserved on shutdown and startup

Definition at line 35 of file wikiuser.hpp.

Referenced by Huggle::Core::LoadDefs(), RetrieveUser(), Huggle::Core::SaveDefs(), TrimProblematicUsersList(), and UpdateUser().


The documentation for this class was generated from the following files: