summaryrefslogtreecommitdiff
path: root/noncore/net/opieirc/ircconnection.cpp
Unidiff
Diffstat (limited to 'noncore/net/opieirc/ircconnection.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opieirc/ircconnection.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/noncore/net/opieirc/ircconnection.cpp b/noncore/net/opieirc/ircconnection.cpp
index 88e63f7..fb7e168 100644
--- a/noncore/net/opieirc/ircconnection.cpp
+++ b/noncore/net/opieirc/ircconnection.cpp
@@ -26,13 +26,14 @@ void IRCConnection::doConnect() {
26 26
27/* Send commands to the IRC server */ 27/* Send commands to the IRC server */
28void IRCConnection::sendLine(QString line) { 28void IRCConnection::sendLine(QString line) {
29 while((line.right(1) == "\n") || (line.right(1) == "\r")) 29 while((line.right(1) == "\n") || (line.right(1) == "\r"))
30 line = line.left(line.length() - 1); 30 line = line.left(line.length() - 1);
31 line.append("\r\n"); 31 line.append("\r\n");
32 m_socket->writeBlock(line, line.length()); 32 QCString uline = line.utf8();
33 m_socket->writeBlock(uline, uline.length());
33} 34}
34 35
35void IRCConnection::sendCTCPReply(const QString &nickname, const QString &type, const QString &args) { 36void IRCConnection::sendCTCPReply(const QString &nickname, const QString &type, const QString &args) {
36 sendLine("NOTICE " + nickname + " :\001" + type + " " + args + "\001"); 37 sendLine("NOTICE " + nickname + " :\001" + type + " " + args + "\001");
37} 38}
38 39
@@ -74,13 +75,13 @@ void IRCConnection::login() {
74 sendLine(loginString); 75 sendLine(loginString);
75} 76}
76 77
77/* Called when data arrives on the socket */ 78/* Called when data arrives on the socket */
78void IRCConnection::dataReady() { 79void IRCConnection::dataReady() {
79 while(m_socket->canReadLine()) { 80 while(m_socket->canReadLine()) {
80 IRCMessage message(m_socket->readLine()); 81 IRCMessage message(QString::fromUtf8(m_socket->readLine()));
81 if (!m_loggedIn && message.isNumerical() && message.commandNumber() == 1) { 82 if (!m_loggedIn && message.isNumerical() && message.commandNumber() == 1) {
82 /* Now autojoin all channels specified inside the server profile */ 83 /* Now autojoin all channels specified inside the server profile */
83 QStringList channels = QStringList::split(QChar(','), m_server->channels()); 84 QStringList channels = QStringList::split(QChar(','), m_server->channels());
84 for (QStringList::Iterator it = channels.begin(); it != channels.end(); ++it) { 85 for (QStringList::Iterator it = channels.begin(); it != channels.end(); ++it) {
85 QString channelName = (*it).stripWhiteSpace(); 86 QString channelName = (*it).stripWhiteSpace();
86 if (channelName.startsWith("#") || channelName.startsWith("+")) { 87 if (channelName.startsWith("#") || channelName.startsWith("+")) {