Yate
|
A Jabber message service. More...
#include <yatejabber.h>
Public Types | |
enum | MsgType { Chat, GroupChat, HeadLine, Normal, Error, None } |
Public Member Functions | |
JBMessage (JBEngine *engine, const NamedList *params, int prio=0) | |
virtual | ~JBMessage () |
virtual void | initialize (const NamedList ¶ms) |
JBEvent * | getMessage () |
virtual void | processMessage (JBEvent *event) |
Static Public Member Functions | |
static XMLElement * | createMessage (const char *type, const char *from, const char *to, const char *id, const char *message) |
static XMLElement * | createMessage (MsgType type, const char *from, const char *to, const char *id, const char *message) |
static MsgType | msgType (const char *text) |
static const char * | msgText (MsgType msg) |
Static Public Attributes | |
static TokenDict | s_msg [] |
Protected Member Functions | |
virtual bool | accept (JBEvent *event, bool &processed, bool &insert) |
A Jabber message service.
This class is a message receiver service for the Jabber engine
Constructor. Constructs a Jabber message service
engine | The Jabber engine |
params | Service's parameters |
prio | The priority of this service |
References JBThreadList::setOwner().
virtual ~JBMessage | ( | ) | [inline, virtual] |
Destructor. Cancel private thread(s)
virtual bool accept | ( | JBEvent * | event, |
bool & | processed, | ||
bool & | insert | ||
) | [protected, virtual] |
Accept an event from the engine and process it if configured to do that
event | The event to accept |
processed | Set to true on exit to signal that the event was already processed |
insert | Set to true if accepted to insert on top of the event queue |
Reimplemented from JBService.
static XMLElement* createMessage | ( | const char * | type, |
const char * | from, | ||
const char * | to, | ||
const char * | id, | ||
const char * | message | ||
) | [static] |
Create a 'message' element
type | Message type string |
from | The 'from' attribute |
to | The 'to' attribute |
id | The 'id' attribute |
message | The message body |
Referenced by JGSession::sendMessage().
static XMLElement* createMessage | ( | MsgType | type, |
const char * | from, | ||
const char * | to, | ||
const char * | id, | ||
const char * | message | ||
) | [inline, static] |
Create a 'message' element
type | Message type as enumeration |
from | The 'from' attribute |
to | The 'to' attribute |
id | The 'id' attribute |
message | The message body |
References JBMessage::createMessage(), and TelEngine::lookup().
Referenced by JBMessage::createMessage().
JBEvent* getMessage | ( | ) | [inline] |
Get a message from queue
virtual void initialize | ( | const NamedList & | params | ) | [virtual] |
static const char* msgText | ( | MsgType | msg | ) | [inline, static] |
Get the text from a message type
msg | The message type |
References TelEngine::lookup().
static MsgType msgType | ( | const char * | text | ) | [inline, static] |
Get the type of a 'message' stanza
text | The text to check |
References TelEngine::lookup().
virtual void processMessage | ( | JBEvent * | event | ) | [virtual] |
Message processor. The derived classes must override this method to process received messages
event | The event to process |