-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathqchatservice.cpp
More file actions
96 lines (79 loc) · 2.04 KB
/
qchatservice.cpp
File metadata and controls
96 lines (79 loc) · 2.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
//#include <QRegExp>
#include <QDebug>
#include "qchatservice.h"
QChatService::QChatService( QObject *parent )
: QObject( parent )
, showSystemMessages_( true )
, aliasesSelection_( false )
, removeBlackListUsers_( false )
, aliasesList_()
, supportersList_()
, blackList_()
{
}
QChatService::~QChatService()
{
}
void QChatService::setShowSystemMessages( bool showSystemMessages )
{
showSystemMessages_ = showSystemMessages;
}
bool QChatService::isShowSystemMessages() const
{
return showSystemMessages_;
}
void QChatService::setAliasesSelection( bool aliasesSelection )
{
aliasesSelection_ = aliasesSelection;
}
bool QChatService::isAliasesSelection() const
{
return aliasesSelection_;
}
void QChatService::setRemoveBlackListUsers( bool removeBlackListUsers )
{
removeBlackListUsers_ = removeBlackListUsers;
}
bool QChatService::isRemoveBlackListUsers() const
{
return removeBlackListUsers_;
}
void QChatService::setAliasesList( const QString &aliasesList )
{
//qDebug() << aliasesList;
aliasesList_ = aliasesList.split( QRegExp( "\\s" ) );
//qDebug() << aliasesList_;
}
const QStringList& QChatService::aliasesList() const
{
return aliasesList_;
}
void QChatService::setSupportersList( const QString &supportersList )
{
//qDebug() << supportersList;
supportersList_ = supportersList.split( QRegExp( "\\s" ) );
// qDebug() << supportersList_;
}
const QStringList& QChatService::supportersList() const
{
return supportersList_;
}
void QChatService::setBlackList( const QString &blackList )
{
//qDebug() << blackList;
blackList_ = blackList.split( QRegExp( "\\s" ) );
//qDebug() << blackList_;
}
const QStringList& QChatService::blackList() const
{
return blackList_;
}
bool QChatService::isContainsAliases( const QString &message ) const
{
foreach( const QString &alias, aliasesList_ )
{
if( alias != "" && message.contains( alias ) )
return true;
}
return false;
}