Interprets communication between the client and the IRC server. More...
#include <ircnetworkadapter.h>
Public Slots | |
void | openNewAdapter (const QString &recipientName) |
Opens a new chat adapter for specified recipient. More... | |
void | print (const QString &printWhat, const QString &printWhere) |
void | printMsgLiteral (const QString &recipient, const QString &content, const IRCMessageClass &msgClass) |
void | printToCurrentChatBox (const QString &printWhat, const IRCMessageClass &msgClass) |
void | printWithClass (const QString &printWhat, const QString &printWhere, const IRCMessageClass &msgClass) |
void | reloadNetworkEntityFromConfig () |
void | userPing (const QString &nickname, qint64 ping) |
Public Slots inherited from IRCAdapterBase | |
void | emitMessageToAllChatBoxes (const QString &message, const IRCMessageClass &msgClass) |
void | sendMessage (const QString &message) |
Signals | |
void | newChatWindowIsOpened (IRCChatAdapter *pWindow) |
Signal emitted when a new chat (priv or channel) is opened from this network. More... | |
Signals inherited from IRCAdapterBase | |
void | error (const QString &error) |
void | focusRequest () |
Called when this adapter requests UI focus. More... | |
void | message (const QString &message) |
void | messageToNetworksCurrentChatBox (const QString &message, const IRCMessageClass &msgClass) |
void | messageWithClass (const QString &message, const IRCMessageClass &messageClass) |
void | terminating () |
void | titleChange () |
Can be called when the variable returned by title() might have changed and the application should be notified of this fact. More... | |
Public Member Functions | |
IRCNetworkAdapter (const IRCNetworkConnectionInfo &connectionInfo) | |
AdapterType | adapterType () const |
Gets adapter type for this adapter instance. More... | |
bool | amIOperator (const QString &channel) const |
Checks if client is an operator on a specified channel. More... | |
void | banUser (const QString &nickname, const QString &reason, const QString &channel) |
Bans specified user from a channel. More... | |
QList< IRCAdapterBase * > | childrenAdapters () |
void | connect () |
const IRCNetworkConnectionInfo & | connection () const |
void | detachChatWindow (const IRCChatAdapter *pAdapter) |
Detaches the specified IRCChatAdapter instance from this network without deleting it. More... | |
void | disconnect (const QString &farewellMessage) |
void | doSendMessage (const QString &message, IRCAdapterBase *pOrigin) |
Implemented to support direct communication between client and server. More... | |
bool | hasRecipient (const QString &recipient) const |
const PatternList & | ignoredUsersPatterns () const |
bool | isAdapterRelated (const IRCAdapterBase *pAdapter) const |
Checks if pAdapter equals this or is one of chat windows of this network. More... | |
bool | isConnected () const |
bool | isMyNickname (const QString &nickname) const |
bool | isOperator (const QString &nickname, const QString &channel) const |
Checks if user is an operator on a given channel. More... | |
void | killAllChatWindows () |
const QString & | myNickname () const |
IRCNetworkAdapter * | network () |
The idea of the adapter system is that each adapter is either a network or is a child of a network. More... | |
IRCResponseParser * | responseParser () |
void | sendCtcp (const QString &nickname, const QString &command) |
void | setChannelMode (const QString &channel, const QString &nickname, const QString &flag, bool bSet) |
Sets channel flags. More... | |
void | setEmitAllIRCMessagesEnabled (bool b) |
void | setNetworkEntity (const IRCNetworkEntity &network) |
QString | title () const |
Gets title for this adapter. More... | |
const IRCUserPrefix & | userPrefixes () const |
All allowed modes with their nickname prefixes for this network. More... | |
Public Member Functions inherited from IRCAdapterBase | |
virtual | ~IRCAdapterBase () |
Destructor emits terminating() signal. More... | |
void | emitError (const QString &strError) |
void | emitFocusRequest () |
void | emitMessage (const QString &strMessage) |
void | emitMessageWithClass (const QString &strMessage, const IRCMessageClass &messageClass) |
const IRCNetworkEntity & | networkEntity () const |
virtual QString | recipient () const |
Friends | |
class | IRCSocketSignalsAdapter |
Additional Inherited Members | |
Public Types inherited from IRCAdapterBase | |
enum | AdapterType { NetworkAdapter, ChannelAdapter, PrivAdapter } |
Defines all possible types of IRC adapters. More... | |
Interprets communication between the client and the IRC server.
Definition at line 27 of file ircnetworkadapter.h.
|
inlinevirtual |
Gets adapter type for this adapter instance.
Implements IRCAdapterBase.
Definition at line 37 of file ircnetworkadapter.h.
|
inline |
Checks if client is an operator on a specified channel.
Definition at line 42 of file ircnetworkadapter.h.
void IRCNetworkAdapter::banUser | ( | const QString & | nickname, |
const QString & | reason, | ||
const QString & | channel | ||
) |
Bans specified user from a channel.
The data that is required to deliver a ban is contained inside the string returned by /whois query.
This will create a IRCDelayedOperation object and first send /whois <nickname> query. When the /whois returns the delayed operations are searched for pending bans. This is when bans are delivered.
For end-user this effect should be almost completely invisible.
nickName | Victim's nick. |
reason | Reason for ban (this will be delivered to /kick message). |
channel | Channel from which the user will be banned. |
Definition at line 155 of file ircnetworkadapter.cpp.
void IRCNetworkAdapter::detachChatWindow | ( | const IRCChatAdapter * | pAdapter | ) |
Detaches the specified IRCChatAdapter instance from this network without deleting it.
Definition at line 178 of file ircnetworkadapter.cpp.
|
virtual |
Implemented to support direct communication between client and server.
All messages that do not begin with '/' character will be ignored here. In fact if the '/' character is missing an error() signal will be emitted to notify the user of this fact.
Programmers must remember that although IRC protocol itself doesn't require clients to prepend the messages with a slash this class always does - the slash character is stripped, then the remainder of the message is sent 'as is'.
pOrigin | If this is not null the IRCNetworkAdapter will attempt to pass some message and error signals through this pOrigin. Otherwise these signals will be sent directly. |
Implements IRCAdapterBase.
Definition at line 189 of file ircnetworkadapter.cpp.
bool IRCNetworkAdapter::isAdapterRelated | ( | const IRCAdapterBase * | pAdapter | ) | const |
Checks if pAdapter equals this or is one of chat windows of this network.
Definition at line 383 of file ircnetworkadapter.cpp.
bool IRCNetworkAdapter::isOperator | ( | const QString & | nickname, |
const QString & | channel | ||
) | const |
Checks if user is an operator on a given channel.
This will work only for known channels (ie. the ones the client is registered on).
Definition at line 408 of file ircnetworkadapter.cpp.
|
inlinevirtual |
The idea of the adapter system is that each adapter is either a network or is a child of a network.
This method is supposed to return a pointer to a network to which this adapter belongs.
Implements IRCAdapterBase.
Definition at line 130 of file ircnetworkadapter.h.
|
signal |
Signal emitted when a new chat (priv or channel) is opened from this network.
|
slot |
Opens a new chat adapter for specified recipient.
If specified recipient is a channel a /join command will be sent to that channel. If recipient is a user a chat window will simply be opened.
If adapter is not connected to a network or empty name is specified this becomes a no-op. Also if such recipient is already present the window will emit focus signal request.
Definition at line 539 of file ircnetworkadapter.cpp.
|
slot |
Definition at line 565 of file ircnetworkadapter.cpp.
void IRCNetworkAdapter::setChannelMode | ( | const QString & | channel, |
const QString & | nickname, | ||
const QString & | flag, | ||
bool | bSet | ||
) |
Sets channel flags.
Flags are set using following command:
Definition at line 654 of file ircnetworkadapter.cpp.
|
inline |
Definition at line 155 of file ircnetworkadapter.h.
|
virtual |
Gets title for this adapter.
Implements IRCAdapterBase.
Definition at line 672 of file ircnetworkadapter.cpp.
const IRCUserPrefix & IRCNetworkAdapter::userPrefixes | ( | ) | const |
All allowed modes with their nickname prefixes for this network.
Definition at line 766 of file ircnetworkadapter.cpp.