projects
/
quassel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make Quassel less crashy (yeah, case sensitivity in channel names is baaaad)... make
[quassel.git]
/
src
/
common
/
ircchannel.cpp
diff --git
a/src/common/ircchannel.cpp
b/src/common/ircchannel.cpp
index
29b618f
..
c669d1f
100644
(file)
--- a/
src/common/ircchannel.cpp
+++ b/
src/common/ircchannel.cpp
@@
-21,6
+21,7
@@
#include "ircchannel.h"
#include "networkinfo.h"
#include "ircchannel.h"
#include "networkinfo.h"
+//#include "nicktreemodel.h"
#include "signalproxy.h"
#include "ircuser.h"
#include "signalproxy.h"
#include "ircuser.h"
@@
-40,6
+41,10
@@
IrcChannel::IrcChannel(const QString &channelname, NetworkInfo *networkinfo)
setObjectName(QString::number(networkInfo->networkId()) + "/" + channelname);
}
setObjectName(QString::number(networkInfo->networkId()) + "/" + channelname);
}
+IrcChannel::~IrcChannel() {
+
+}
+
// ====================
// PUBLIC:
// ====================
// ====================
// PUBLIC:
// ====================
@@
-84,15
+89,15
@@
QList<IrcUser *> IrcChannel::ircUsers() const {
return _userModes.keys();
}
return _userModes.keys();
}
-QString IrcChannel::userMode(IrcUser *ircuser) const {
+QString IrcChannel::userMode
s
(IrcUser *ircuser) const {
if(_userModes.contains(ircuser))
return _userModes[ircuser];
else
return QString();
}
if(_userModes.contains(ircuser))
return _userModes[ircuser];
else
return QString();
}
-QString IrcChannel::userMode(const QString &nick) const {
- return userMode(networkInfo->ircUser(nick));
+QString IrcChannel::userMode
s
(const QString &nick) const {
+ return userMode
s
(networkInfo->ircUser(nick));
}
// ====================
}
// ====================
@@
-107,8
+112,11
@@
void IrcChannel::join(IrcUser *ircuser) {
if(!_userModes.contains(ircuser) && ircuser) {
_userModes[ircuser] = QString();
ircuser->joinChannel(name());
if(!_userModes.contains(ircuser) && ircuser) {
_userModes[ircuser] = QString();
ircuser->joinChannel(name());
+ connect(ircuser, SIGNAL(nickSet(QString)), this, SLOT(ircUserNickSet(QString)));
connect(ircuser, SIGNAL(destroyed()), this, SLOT(ircUserDestroyed()));
connect(ircuser, SIGNAL(destroyed()), this, SLOT(ircUserDestroyed()));
- // no emit here since the join is propagated by IrcUser
+ // if you wonder why there is no counterpart to ircUserJoined:
+ // the joines are propagted by the ircuser. the signal ircUserJoined is only for convenience
+ emit ircUserJoined(ircuser);
}
}
}
}
@@
-120,7
+128,9
@@
void IrcChannel::part(IrcUser *ircuser) {
if(isKnownUser(ircuser)) {
_userModes.remove(ircuser);
ircuser->partChannel(name());
if(isKnownUser(ircuser)) {
_userModes.remove(ircuser);
ircuser->partChannel(name());
- // no emit here since the part is propagated by IrcUser
+ // if you wonder why there is no counterpart to ircUserParted:
+ // the joines are propagted by the ircuser. the signal ircUserParted is only for convenience
+ emit ircUserParted(ircuser);
}
}
}
}
@@
-133,6
+143,7
@@
void IrcChannel::setUserModes(IrcUser *ircuser, const QString &modes) {
if(isKnownUser(ircuser)) {
_userModes[ircuser] = modes;
emit userModesSet(ircuser->nick(), modes);
if(isKnownUser(ircuser)) {
_userModes[ircuser] = modes;
emit userModesSet(ircuser->nick(), modes);
+ emit ircUserModesSet(ircuser, modes);
}
}
}
}
@@
-144,10
+155,11
@@
void IrcChannel::setUserModes(const QString &nick, const QString &modes) {
void IrcChannel::addUserMode(IrcUser *ircuser, const QString &mode) {
if(!isKnownUser(ircuser) || !isValidChannelUserMode(mode))
return;
void IrcChannel::addUserMode(IrcUser *ircuser, const QString &mode) {
if(!isKnownUser(ircuser) || !isValidChannelUserMode(mode))
return;
-
+
if(!_userModes[ircuser].contains(mode)) {
_userModes[ircuser] += mode;
emit userModeAdded(ircuser->nick(), mode);
if(!_userModes[ircuser].contains(mode)) {
_userModes[ircuser] += mode;
emit userModeAdded(ircuser->nick(), mode);
+ emit ircUserModeAdded(ircuser, mode);
}
}
}
}
@@
-156,7
+168,6
@@
void IrcChannel::addUserMode(const QString &nick, const QString &mode) {
addUserMode(networkInfo->ircUser(nick), mode);
}
addUserMode(networkInfo->ircUser(nick), mode);
}
-
// REMOVE USER MODE
void IrcChannel::removeUserMode(IrcUser *ircuser, const QString &mode) {
if(!isKnownUser(ircuser) || !isValidChannelUserMode(mode))
// REMOVE USER MODE
void IrcChannel::removeUserMode(IrcUser *ircuser, const QString &mode) {
if(!isKnownUser(ircuser) || !isValidChannelUserMode(mode))
@@
-165,6
+176,7
@@
void IrcChannel::removeUserMode(IrcUser *ircuser, const QString &mode) {
if(_userModes[ircuser].contains(mode)) {
_userModes[ircuser].remove(mode);
emit userModeRemoved(ircuser->nick(), mode);
if(_userModes[ircuser].contains(mode)) {
_userModes[ircuser].remove(mode);
emit userModeRemoved(ircuser->nick(), mode);
+ emit ircUserModeRemoved(ircuser, mode);
}
}
}
}
@@
-198,6
+210,12
@@
void IrcChannel::ircUserDestroyed() {
_userModes.remove(ircUser);
}
_userModes.remove(ircUser);
}
+void IrcChannel::ircUserNickSet(QString nick) {
+ IrcUser *ircUser = qobject_cast<IrcUser *>(sender());
+ Q_ASSERT(ircUser);
+ emit ircUserNickSet(ircUser, nick);
+}
+
void IrcChannel::setInitialized() {
_initialized = true;
emit initDone();
void IrcChannel::setInitialized() {
_initialized = true;
emit initDone();