Communi  3.7.0
A cross-platform IRC framework written with Qt
Loading...
Searching...
No Matches
IrcUser Class Reference

Keeps track of user status on a channel. More...

#include <IrcUser>

Public Member Functions

 IrcUser (QObject *parent=nullptr)
 
 ~IrcUser () override
 
IrcChannelchannel () const
 
QString mode () const
 
QString name () const
 
QString prefix () const
 
QString title () const
 

Properties

bool away
 
bool servOp
 

Detailed Description

See also
IrcUserModel

Constructor & Destructor Documentation

◆ IrcUser()

IrcUser::IrcUser ( QObject * parent = nullptr)
explicit

Constructs a new user with parent.

◆ ~IrcUser()

IrcUser::~IrcUser ( )
override

Destructs the user object.

Member Function Documentation

◆ channel()

IrcChannel * IrcUser::channel ( ) const

This property holds the channel of the user.

Access function:

◆ mode()

QString IrcUser::mode ( ) const

This property holds the mode letter.

Typical mode letters are o (op) and v (voice).

Note
The mode may be multiple characters if the multi-prefix capability is enabled.
Access function:
  • QString mode() const
Notifier signal:
  • void modeChanged(const QString& mode)
See also
prefix, IRCv3 support

◆ name()

QString IrcUser::name ( ) const

This property holds the name.

Access function:
  • QString name() const
Notifier signal:
  • void nameChanged(const QString& name)

◆ prefix()

QString IrcUser::prefix ( ) const

This property holds the prefix character.

Typical prefix characters are @ (op) and + (voice).

Note
The prefix may be multiple characters if the multi-prefix capability is enabled.
Access function:
  • QString prefix() const
Notifier signal:
  • void prefixChanged(const QString& prefix)
See also
mode, IRCv3 support

◆ title()

QString IrcUser::title ( ) const

This property holds the title.

The title consists of prefix and name.

Access function:
  • QString title() const
Notifier signal:
  • void titleChanged(const QString& title)

Property Documentation

◆ away

bool IrcUser::away
read
Since
3.1

This property holds whether the user is marked as being away.

Note
IRC servers do not send this information by default. In order to fetch the information for all users on a channel, issue a WHO command on the channel:
IrcChannel* channel = user->channel();
IrcCommand* command = IrcCommand::createWho(channel->title());
channel->sendCommand(command);
Q_INVOKABLE bool sendCommand(IrcCommand *command)
Definition ircbuffer.cpp:578
bool channel
Definition ircbuffer.h:59
Keeps track of channel status.
Definition ircchannel.h:41
Provides the most common commands.
Definition irccommand.h:45
static Q_INVOKABLE IrcCommand * createWho(const QString &mask, bool operators=false)
Definition irccommand.cpp:875
Access function:
  • bool isAway() const
Notifier signal:
  • void awayChanged(bool away)

◆ servOp

bool IrcUser::servOp
read
Since
3.1

This property holds whether the user is a server operator.

Note
IRC servers do not send this information by default. In order to fetch the information for all users on a channel, issue a WHO command on the channel:
IrcChannel* channel = user->channel();
IrcCommand* command = IrcCommand::createWho(channel->title());
channel->sendCommand(command);
Access function:
  • bool isServOp() const
Notifier signal:
  • void servOpChanged(bool servOp)