irccd  3.0.3
Public Types | Static Public Member Functions | Public Attributes | List of all members
irccd::daemon::server_util::message_type Struct Reference

Pack a message and its type. More...

#include <server_util.hpp>

Public Types

enum  kind { is_command, is_message }
 Describe which type of message has been received. More...
 

Static Public Member Functions

static auto parse (std::string_view message, std::string_view cchar, std::string_view plugin) -> message_type
 

Public Attributes

kind type
 
std::string message
 

Detailed Description

Pack a message and its type.

On channels and queries, you may have a special command or a standard message depending on the beginning of the message.

Example: ‘!reminder help’ may invoke the command event if a plugin reminder exists.

Member Enumeration Documentation

◆ kind

Describe which type of message has been received.

Enumerator
is_command 

special command

is_message 

standard message

Member Function Documentation

◆ parse()

static auto irccd::daemon::server_util::message_type::parse ( std::string_view  message,
std::string_view  cchar,
std::string_view  plugin 
) -> message_type
static

Parse IRC message and determine if it's a command or a simple message.

If it's a command, the plugin invocation command is removed from the original message, otherwise it is copied verbatime.

Parameters
messagethe message line
ccharthe command char (e.g '!')
pluginthe plugin name
Returns
the pair

Member Data Documentation

◆ message

std::string irccd::daemon::server_util::message_type::message

Message content.

◆ type

kind irccd::daemon::server_util::message_type::type

Message kind.


The documentation for this struct was generated from the following file: