eric7.Network.IRC.IrcChannelWidget

Module implementing the IRC channel widget.

Global Attributes

None

Classes

IrcChannelWidget Class implementing the IRC channel widget.
IrcUserItem Class implementing a list widget item containing an IRC channel user.

Functions

None


IrcChannelWidget

Class implementing the IRC channel widget.

Signals

awayCommand(str)
emitted to set the away status via the /away command
channelClosed(str)
emitted after the user has left the channel
leaveAllChannels()
emitted to leave all channels
leaveChannels(list)
emitted to leave a list of channels
openPrivateChat(str)
emitted to open a "channel" for private messages
sendCtcpReply(str, str)
emitted to send a CTCP reply
sendCtcpRequest(str, str, str)
emitted to send a CTCP request
sendData(str)
emitted to send a message to the channel

Derived from

QWidget, Ui_IrcChannelWidget

Class Attributes

JoinIndicator
LeaveIndicator
MessageIndicator
UrlRe

Class Methods

None

Methods

IrcChannelWidget Constructor
__addManagementMessage Private method to add a channel management message to the list.
__appendMessage Private slot to append a message.
__autoWhoEntry Private method to handle a WHO entry returned by the server as requested automatically.
__channelCreated Private method to handle a channel created message.
__channelModes Private method to handle a message reporting the channel modes.
__channelUrl Private method to handle a channel URL message.
__clearMessages Private slot to clear the contents of the messages display.
__copyAllMessages Private slot to copy the contents of the messages display to the clipboard.
__copyMessages Private slot to copy the selection of the messages display to the clipboard.
__cutAllMessages Private slot to cut the contents of the messages display to the clipboard.
__extractPrivilege Private method to extract the user privileges out of the name.
__findUser Private method to find the user in the list of users.
__handleCtcp Private method to handle a CTCP channel command.
__help Private method to handle a help message.
__ignore Private method to handle a channel message we are not interested in.
__ignoreUser Private slot to ignore a specific user.
__initMessagesMenu Private slot to initialize the context menu of the messages pane.
__initUsersMenu Private slot to initialize the users list context menu.
__message Private method to handle messages to the channel.
__openPrivateChat Private slot to open a chat with the selected user.
__pingUser Private slot to send a ping to a specific user.
__processUserMessage Private method to process a message entered by the user or via the user list context menu.
__saveMessages Private slot to save the contents of the messages display.
__sendAutoWhoCommand Private slot to send the WHO command to update the users list.
__sendUserMessage Private slot to send a private message to a specific user.
__sendUserNotice Private slot to send a notice message to a specific user.
__sendUserQuery Private slot to send a query message to a specific user.
__setEditTopicButton Private method to set the visibility of the Edit Topic button.
__setTopic Private method to handle a topic change of the channel.
__setUserPrivilege Private method to handle a change of user privileges for the channel.
__topicCreated Private method to handle a topic created message.
__updateChannelModes Private method to handle a message reporting the channel modes.
__userAway Private method to handle a topic change of the channel.
__userJoin Private method to handle a user joining the channel.
__userList Private method to handle the receipt of a list of users of the channel.
__userNickChange Private method to handle a nickname change of a user.
__userPart Private method to handle a user leaving the channel.
__userQuit Private method to handle a user logging off the server.
__whoEnd Private method to handle the end of the WHO list.
__whoEntry Private method to handle a WHO entry returned by the server as requested manually.
__whoIs Private slot to get information about the selected user.
__whoIsAccount Private method to handle the WHOIS account reply.
__whoIsActually Private method to handle the WHOIS actually reply.
__whoIsChannels Private method to handle the WHOIS channels reply.
__whoIsConnection Private method to handle the WHOIS connection reply.
__whoIsEnd Private method to handle the end of WHOIS reply.
__whoIsHelper Private method to handle the WHOIS helper reply.
__whoIsIdentify Private method to handle the WHOIS identify and identified replies.
__whoIsIdle Private method to handle the WHOIS idle reply.
__whoIsOperator Private method to handle the WHOIS operator reply.
__whoIsSecure Private method to handle the WHOIS secure reply.
__whoIsServer Private method to handle the WHOIS server reply.
__whoIsUser Private method to handle the WHOIS user reply.
addMessage Public method to add a message from external.
addUsers Public method to add users to the channel.
getUsersCount Public method to get the users count of the channel.
handleMessage Public method to handle the message sent by the server.
hideEvent Protected method handling hide events.
initAutoWho Public method to initialize the Auto Who system.
leaveChannel Public slot to leave the channel.
name Public method to get the name of the channel.
on_editTopicButton_clicked Private slot to change the topic of the channel.
on_messageEdit_returnPressed Private slot to send a message to the channel.
on_messages_anchorClicked Private slot to open links in the default browser.
on_messages_copyAvailable Private slot to react to text selection/deselection of the messages edit.
on_messages_customContextMenuRequested Private slot to show the context menu of the messages pane.
on_usersList_customContextMenuRequested Private slot to show the context menu of the users list.
partMessage Public method to get the part message.
requestLeave Public method to leave the channel.
setMarkerLine Public method to draw a line to mark the current position.
setName Public method to set the name of the channel.
setPartMessage Public method to set the part message.
setPrivate Public method to set the private chat mode.
setPrivateInfo Public method to set some info text for private chat mode.
setUserName Public method to set the user name for the channel.
setUserPrivilegePrefix Public method to set the user privilege to prefix mapping.
showEvent Protected method handling show events.
unsetMarkerLine Public method to remove the marker line.
userName Public method to get the nick name of the user.

Static Methods

None

IrcChannelWidget (Constructor)

IrcChannelWidget(parent=None)

Constructor

parent (QWidget)
reference to the parent widget

IrcChannelWidget.__addManagementMessage

__addManagementMessage(indicator, message)

Private method to add a channel management message to the list.

indicator (str)
indicator to be shown
message (str)
message to be shown

IrcChannelWidget.__appendMessage

__appendMessage(message)

Private slot to append a message.

message (str)
message to be appended

IrcChannelWidget.__autoWhoEntry

__autoWhoEntry(match)

Private method to handle a WHO entry returned by the server as requested automatically.

match (re.Match)
match object that matched the pattern
Return:
flag indicating whether the message was handled
Return Type:
bool

IrcChannelWidget.__channelCreated

__channelCreated(match)

Private method to handle a channel created message.

match (re.Match)
match object that matched the pattern
Return:
flag indicating whether the message was handled
Return Type:
bool

IrcChannelWidget.__channelModes

__channelModes(match)

Private method to handle a message reporting the channel modes.

match (re.Match)
match object that matched the pattern
Return:
flag indicating whether the message was handled
Return Type:
bool

IrcChannelWidget.__channelUrl

__channelUrl(match)

Private method to handle a channel URL message.

match (re.Match)
match object that matched the pattern
Return:
flag indicating whether the message was handled
Return Type:
bool

IrcChannelWidget.__clearMessages

__clearMessages()

Private slot to clear the contents of the messages display.

IrcChannelWidget.__copyAllMessages

__copyAllMessages()

Private slot to copy the contents of the messages display to the clipboard.

IrcChannelWidget.__copyMessages

__copyMessages()

Private slot to copy the selection of the messages display to the clipboard.

IrcChannelWidget.__cutAllMessages

__cutAllMessages()

Private slot to cut the contents of the messages display to the clipboard.

IrcChannelWidget.__extractPrivilege

__extractPrivilege(name)

Private method to extract the user privileges out of the name.

name (str)
user name and prefixes
Return:
tuple containing a list of privileges and user name
Return Type:
tuple of (list of str, str)

IrcChannelWidget.__findUser

__findUser(name)

Private method to find the user in the list of users.

name (str)
user name to search for
Return:
reference to the list entry
Return Type:
QListWidgetItem

IrcChannelWidget.__handleCtcp

__handleCtcp(match)

Private method to handle a CTCP channel command.

match (re.Match)
reference to the match object
Return:
flag indicating, if the message was handled
Return Type:
bool

IrcChannelWidget.__help

__help(match)

Private method to handle a help message.

match (re.Match)
match object that matched the pattern
Return:
flag indicating whether the message was handled
Return Type:
bool

IrcChannelWidget.__ignore

__ignore(match)

Private method to handle a channel message we are not interested in.

match (re.Match)
match object that matched the pattern
Return:
flag indicating whether the message was handled
Return Type:
bool

IrcChannelWidget.__ignoreUser

__ignoreUser()

Private slot to ignore a specific user.

IrcChannelWidget.__initMessagesMenu

__initMessagesMenu()

Private slot to initialize the context menu of the messages pane.

IrcChannelWidget.__initUsersMenu

__initUsersMenu()

Private slot to initialize the users list context menu.

IrcChannelWidget.__message

__message(match)

Private method to handle messages to the channel.

match (re.Match)
match object that matched the pattern
Return:
flag indicating whether the message was handled
Return Type:
bool

IrcChannelWidget.__openPrivateChat

__openPrivateChat()

Private slot to open a chat with the selected user.

IrcChannelWidget.__pingUser

__pingUser()

Private slot to send a ping to a specific user.

IrcChannelWidget.__processUserMessage

__processUserMessage(msg)

Private method to process a message entered by the user or via the user list context menu.

msg (str)
message to be processed

IrcChannelWidget.__saveMessages

__saveMessages()

Private slot to save the contents of the messages display.

IrcChannelWidget.__sendAutoWhoCommand

__sendAutoWhoCommand()

Private slot to send the WHO command to update the users list.

IrcChannelWidget.__sendUserMessage

__sendUserMessage()

Private slot to send a private message to a specific user.

IrcChannelWidget.__sendUserNotice

__sendUserNotice()

Private slot to send a notice message to a specific user.

IrcChannelWidget.__sendUserQuery

__sendUserQuery()

Private slot to send a query message to a specific user.

IrcChannelWidget.__setEditTopicButton

__setEditTopicButton()

Private method to set the visibility of the Edit Topic button.

IrcChannelWidget.__setTopic

__setTopic(match)

Private method to handle a topic change of the channel.

match (re.Match)
match object that matched the pattern
Return:
flag indicating whether the message was handled
Return Type:
bool

IrcChannelWidget.__setUserPrivilege

__setUserPrivilege(match)

Private method to handle a change of user privileges for the channel.

match (re.Match)
match object that matched the pattern
Return:
flag indicating whether the message was handled
Return Type:
bool

IrcChannelWidget.__topicCreated

__topicCreated(match)

Private method to handle a topic created message.

match (re.Match)
match object that matched the pattern
Return:
flag indicating whether the message was handled
Return Type:
bool

IrcChannelWidget.__updateChannelModes

__updateChannelModes(match)

Private method to handle a message reporting the channel modes.

match (re.Match)
match object that matched the pattern
Return:
flag indicating whether the message was handled
Return Type:
bool

IrcChannelWidget.__userAway

__userAway(match)

Private method to handle a topic change of the channel.

match (re.Match)
match object that matched the pattern
Return:
flag indicating whether the message was handled
Return Type:
bool

IrcChannelWidget.__userJoin

__userJoin(match)

Private method to handle a user joining the channel.

match (re.Match)
match object that matched the pattern
Return:
flag indicating whether the message was handled
Return Type:
bool

IrcChannelWidget.__userList

__userList(match)

Private method to handle the receipt of a list of users of the channel.

match (re.Match)
match object that matched the pattern
Return:
flag indicating whether the message was handled
Return Type:
bool

IrcChannelWidget.__userNickChange

__userNickChange(match)

Private method to handle a nickname change of a user.

match (re.Match)
match object that matched the pattern
Return:
flag indicating whether the message was handled
Return Type:
bool

IrcChannelWidget.__userPart

__userPart(match)

Private method to handle a user leaving the channel.

match (re.Match)
match object that matched the pattern
Return:
flag indicating whether the message was handled
Return Type:
bool

IrcChannelWidget.__userQuit

__userQuit(match)

Private method to handle a user logging off the server.

match (re.Match)
match object that matched the pattern
Return:
flag indicating whether the message was handled
Return Type:
bool

IrcChannelWidget.__whoEnd

__whoEnd(match)

Private method to handle the end of the WHO list.

match (re.Match)
match object that matched the pattern
Return:
flag indicating whether the message was handled
Return Type:
bool

IrcChannelWidget.__whoEntry

__whoEntry(match)

Private method to handle a WHO entry returned by the server as requested manually.

match (re.Match)
match object that matched the pattern
Return:
flag indicating whether the message was handled
Return Type:
bool

IrcChannelWidget.__whoIs

__whoIs()

Private slot to get information about the selected user.

IrcChannelWidget.__whoIsAccount

__whoIsAccount(match)

Private method to handle the WHOIS account reply.

match (re.Match)
match object that matched the pattern
Return:
flag indicating whether the message was handled
Return Type:
bool

IrcChannelWidget.__whoIsActually

__whoIsActually(match)

Private method to handle the WHOIS actually reply.

match (re.Match)
match object that matched the pattern
Return:
flag indicating whether the message was handled
Return Type:
bool

IrcChannelWidget.__whoIsChannels

__whoIsChannels(match)

Private method to handle the WHOIS channels reply.

match (re.Match)
match object that matched the pattern
Return:
flag indicating whether the message was handled
Return Type:
bool

IrcChannelWidget.__whoIsConnection

__whoIsConnection(match)

Private method to handle the WHOIS connection reply.

match (re.Match)
match object that matched the pattern
Return:
flag indicating whether the message was handled
Return Type:
bool

IrcChannelWidget.__whoIsEnd

__whoIsEnd(match)

Private method to handle the end of WHOIS reply.

match (re.Match)
match object that matched the pattern
Return:
flag indicating whether the message was handled
Return Type:
bool

IrcChannelWidget.__whoIsHelper

__whoIsHelper(match)

Private method to handle the WHOIS helper reply.

match (re.Match)
match object that matched the pattern
Return:
flag indicating whether the message was handled
Return Type:
bool

IrcChannelWidget.__whoIsIdentify

__whoIsIdentify(match)

Private method to handle the WHOIS identify and identified replies.

match (re.Match)
match object that matched the pattern
Return:
flag indicating whether the message was handled
Return Type:
bool

IrcChannelWidget.__whoIsIdle

__whoIsIdle(match)

Private method to handle the WHOIS idle reply.

match (re.Match)
match object that matched the pattern
Return:
flag indicating whether the message was handled
Return Type:
bool

IrcChannelWidget.__whoIsOperator

__whoIsOperator(match)

Private method to handle the WHOIS operator reply.

match (re.Match)
match object that matched the pattern
Return:
flag indicating whether the message was handled
Return Type:
bool

IrcChannelWidget.__whoIsSecure

__whoIsSecure(match)

Private method to handle the WHOIS secure reply.

match (re.Match)
match object that matched the pattern
Return:
flag indicating whether the message was handled
Return Type:
bool

IrcChannelWidget.__whoIsServer

__whoIsServer(match)

Private method to handle the WHOIS server reply.

match (re.Match)
match object that matched the pattern
Return:
flag indicating whether the message was handled
Return Type:
bool

IrcChannelWidget.__whoIsUser

__whoIsUser(match)

Private method to handle the WHOIS user reply.

match (re.Match)
match object that matched the pattern
Return:
flag indicating whether the message was handled
Return Type:
bool

IrcChannelWidget.addMessage

addMessage(sender, msg)

Public method to add a message from external.

sender (str)
nick name of the sender
msg (str)
message received from sender

IrcChannelWidget.addUsers

addUsers(users)

Public method to add users to the channel.

users (list of str)
list of user names to add

IrcChannelWidget.getUsersCount

getUsersCount()

Public method to get the users count of the channel.

Return:
users count of the channel
Return Type:
int

IrcChannelWidget.handleMessage

handleMessage(line)

Public method to handle the message sent by the server.

line (str)
server message
Return:
flag indicating, if the message was handled
Return Type:
bool

IrcChannelWidget.hideEvent

hideEvent(_evt)

Protected method handling hide events.

_evt (QHideEvent)
reference to the hide event (unused)

IrcChannelWidget.initAutoWho

initAutoWho()

Public method to initialize the Auto Who system.

IrcChannelWidget.leaveChannel

leaveChannel()

Public slot to leave the channel.

IrcChannelWidget.name

name()

Public method to get the name of the channel.

Return:
name of the channel
Return Type:
str

IrcChannelWidget.on_editTopicButton_clicked

on_editTopicButton_clicked()

Private slot to change the topic of the channel.

IrcChannelWidget.on_messageEdit_returnPressed

on_messageEdit_returnPressed()

Private slot to send a message to the channel.

IrcChannelWidget.on_messages_anchorClicked

on_messages_anchorClicked(url)

Private slot to open links in the default browser.

url (QUrl)
URL to be opened

IrcChannelWidget.on_messages_copyAvailable

on_messages_copyAvailable(yes)

Private slot to react to text selection/deselection of the messages edit.

yes (bool)
flag signaling the availability of selected text

IrcChannelWidget.on_messages_customContextMenuRequested

on_messages_customContextMenuRequested(pos)

Private slot to show the context menu of the messages pane.

pos (QPoint)
the position of the mouse pointer

IrcChannelWidget.on_usersList_customContextMenuRequested

on_usersList_customContextMenuRequested(pos)

Private slot to show the context menu of the users list.

pos (QPoint)
the position of the mouse pointer

IrcChannelWidget.partMessage

partMessage()

Public method to get the part message.

Return:
part message
Return Type:
str

IrcChannelWidget.requestLeave

requestLeave()

Public method to leave the channel.

IrcChannelWidget.setMarkerLine

setMarkerLine()

Public method to draw a line to mark the current position.

IrcChannelWidget.setName

setName(name)

Public method to set the name of the channel.

name (str)
of the channel

IrcChannelWidget.setPartMessage

setPartMessage(message)

Public method to set the part message.

message (str)
message to be used for PART messages

IrcChannelWidget.setPrivate

setPrivate(private, partner="")

Public method to set the private chat mode.

private (bool)
flag indicating private chat mode
partner (str)
name of the partner user

IrcChannelWidget.setPrivateInfo

setPrivateInfo(infoText)

Public method to set some info text for private chat mode.

infoText (str)
info text to be shown

IrcChannelWidget.setUserName

setUserName(name)

Public method to set the user name for the channel.

name (str)
user name for the channel

IrcChannelWidget.setUserPrivilegePrefix

setUserPrivilegePrefix(prefixes)

Public method to set the user privilege to prefix mapping.

prefixes (dict)
dictionary with privilege as key and prefix as value

IrcChannelWidget.showEvent

showEvent(_evt)

Protected method handling show events.

_evt (QShowEvent)
reference to the show event (unused)

IrcChannelWidget.unsetMarkerLine

unsetMarkerLine()

Public method to remove the marker line.

IrcChannelWidget.userName

userName()

Public method to get the nick name of the user.

Return:
nick name of the user
Return Type:
str
Up


IrcUserItem

Class implementing a list widget item containing an IRC channel user.

Derived from

QListWidgetItem

Class Attributes

Admin
Away
Halfop
Normal
Operator
Owner
PrivilegeMapping
Voice

Class Methods

None

Methods

IrcUserItem Constructor
__awayIcon Private method to convert an icon to an away icon.
__setIcon Private method to set the icon dependent on user privileges.
__setText Private method to set the user item text.
canChangeTopic Public method to check, if the user is allowed to change the topic.
changePrivilege Public method to set or unset a user privilege.
clearPrivileges Public method to clear the user privileges.
isIgnored Public method to check, if this user is ignored.
name Public method to get the user name.
parseWhoFlags Public method to parse the user flags reported by a WHO command.
setIgnored Public method to set the user status to ignored.
setName Public method to set a new nick name.

Static Methods

None

IrcUserItem (Constructor)

IrcUserItem(name, parent=None)

Constructor

name (str)
string with user name and privilege prefix
parent (QListWidget or QListWidgetItem)
reference to the parent widget

IrcUserItem.__awayIcon

__awayIcon(icon)

Private method to convert an icon to an away icon.

icon (QIcon)
icon to be converted
Return:
away icon
Return Type:
QIcon

IrcUserItem.__setIcon

__setIcon()

Private method to set the icon dependent on user privileges.

IrcUserItem.__setText

__setText()

Private method to set the user item text.

IrcUserItem.canChangeTopic

canChangeTopic()

Public method to check, if the user is allowed to change the topic.

Return:
flag indicating that the topic can be changed
Return Type:
bool

IrcUserItem.changePrivilege

changePrivilege(privilege)

Public method to set or unset a user privilege.

privilege (str)
privilege to set or unset

IrcUserItem.clearPrivileges

clearPrivileges()

Public method to clear the user privileges.

IrcUserItem.isIgnored

isIgnored()

Public method to check, if this user is ignored.

Return:
flag indicating the ignored status
Return Type:
bool

IrcUserItem.name

name()

Public method to get the user name.

Return:
user name
Return Type:
str

IrcUserItem.parseWhoFlags

parseWhoFlags(flags)

Public method to parse the user flags reported by a WHO command.

flags (str)
user flags as reported by WHO

IrcUserItem.setIgnored

setIgnored(ignored)

Public method to set the user status to ignored.

ignored (bool)
flag indicating the new ignored status

IrcUserItem.setName

setName(name)

Public method to set a new nick name.

name (str)
new nick name for the user
Up