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. | |
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) |
![]() | |
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. | |
![]() | |
void | error (const QString &error) |
void | focusRequest () |
Called when this adapter requests UI focus. | |
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. | |
Public Member Functions | |
IRCNetworkAdapter (IRCNetworkConnectionInfo connectionInfo) | |
AdapterType | adapterType () const override |
Gets adapter type for this adapter instance. | |
bool | amIOperator (const QString &channel) const |
Checks if client is an operator on a specified channel. | |
void | banUser (const QString &nickname, const QString &reason, const QString &channel) |
Bans specified user from a channel. | |
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. | |
void | disconnect (const QString &farewellMessage) |
void | doSendMessage (const QString &message, IRCAdapterBase *pOrigin) override |
Implemented to support direct communication between client and server. | |
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. | |
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. | |
void | killAllChatWindows () |
const QString & | myNickname () const |
IRCNetworkAdapter * | network () override |
The idea of the adapter system is that each adapter is either a network or is a child of a network. | |
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. | |
void | setEmitAllIRCMessagesEnabled (bool b) |
void | setNetworkEntity (const IRCNetworkEntity &network) |
QString | title () const override |
Gets title for this adapter. | |
const IRCUserPrefix & | userPrefixes () const |
All allowed modes with their nickname prefixes for this network. | |
![]() | |
virtual | ~IRCAdapterBase () override |
Destructor emits terminating() signal. | |
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 | |
![]() | |
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 44 of file ircnetworkadapter.h.
|
inlineoverridevirtual |
Gets adapter type for this adapter instance.
Implements IRCAdapterBase.
Definition at line 54 of file ircnetworkadapter.h.
|
inline |
Checks if client is an operator on a specified channel.
Definition at line 62 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.
|
overridevirtual |
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 361 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 382 of file ircnetworkadapter.cpp.
|
inlineoverridevirtual |
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 156 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 507 of file ircnetworkadapter.cpp.
|
slot |
Definition at line 529 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 608 of file ircnetworkadapter.cpp.
|
inline |
Definition at line 181 of file ircnetworkadapter.h.
|
overridevirtual |
Gets title for this adapter.
Implements IRCAdapterBase.
Definition at line 622 of file ircnetworkadapter.cpp.
const IRCUserPrefix & IRCNetworkAdapter::userPrefixes | ( | ) | const |
All allowed modes with their nickname prefixes for this network.
Definition at line 714 of file ircnetworkadapter.cpp.