blob: 7a2d75501f785e0dbfab9627b05c4fd232431942 (
plain) (
blame)
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
97
98
99
100
101
102
103
104
105
106
107
108
|
/*
# Copyright (c) 2009 - OpenSLX Project, Computer Center University of Freiburg
#
# This program is free software distributed under the GPL version 2.
# See http://openslx.org/COPYING
#
# If you have any feedback please consult http://openslx.org/feedback and
# send your suggestions, praise, or complaints to feedback@openslx.org
#
# General information about OpenSLX can be found at http://openslx.org/
*/
// pvsChatMsg.cpp
#include "src/core/pvsChatMsg.h"
#include <QStringList>
PVSChatMsg::PVSChatMsg(PVSMsg pvsMsg)
{
QStringList l = pvsMsg.getMessage().split(":");
if(l[0] == "")
{
_command = pvsMsg.getIdent();
_nickFrom = "unseted";
_nickTo = "unseted";
_msg = "unseted";
if(l[2] == "local")
{
_username = l[1];
_ip = pvsMsg.getRemoteIp();
}
else
{
_username = l[1];
_ip = l[2];
}
}
else
{
_nickFrom = l[0];
_msg = pvsMsg.getMessage().remove(0, l[0].size()+1);
_nickTo = pvsMsg.getIdent();
_command = "unseted";
_username = "unseted";
_ip = "unseted";
}
}
PVSChatMsg::~PVSChatMsg(){};
void PVSChatMsg::setNickFrom(QString nick)
{
_nickFrom = nick;
}
void PVSChatMsg::setNickTo(QString nick)
{
_nickTo = nick;
}
void PVSChatMsg::setMsg(QString msg)
{
_msg = msg;
}
QString PVSChatMsg::getNickFrom()
{
return _nickFrom;
}
QString PVSChatMsg::getNickTo()
{
return _nickTo;
}
QString PVSChatMsg::getMsg()
{
return _msg;
}
QString PVSChatMsg::getCommand()
{
return _command;
}
QString PVSChatMsg::getUsername()
{
return _username;
}
QString PVSChatMsg::getIp()
{
return _ip;
}
bool PVSChatMsg::isCommand()
{
if(_command == "unseted")
{
return false;
}
else
{
return true;
}
}
|