|
|
This class is a message receiver service for the Jabber engine
enum MsgType { Chat, GroupChat, HeadLine, Normal, Error, None, } | MsgType |
Message type enumeration
inline JBMessage (JBEngine* engine, const NamedList* params, int prio = 0)
| JBMessage |
Constructor. Constructs a Jabber message service
Parameters:
engine | The Jabber engine |
params | Service's parameters |
prio | The priority of this service |
~JBMessage ()
| ~JBMessage |
[virtual]
Destructor. Cancel private thread(s)
void initialize (const NamedList& params)
| initialize |
[virtual]
Initialize the service
Parameters:
params | Service's parameters |
Reimplemented from JBService.
inline JBEvent* getMessage ()
| getMessage |
Get a message from queue
Returns: JBEvent pointer or 0 if no messages
void processMessage (JBEvent* event)
| processMessage |
[virtual]
Message processor. The derived classes must override this method to process received messages
Parameters:
event | The event to process |
XMLElement* createMessage (const char* type, const char* from,
const char* to, const char* id, const char* message)
| createMessage |
[static]
Create a 'message' element
Parameters:
type | Message type string |
from | The 'from' attribute |
to | The 'to' attribute |
id | The 'id' attribute |
message | The message body |
Returns: A valid XMLElement pointer
inline XMLElement* createMessage (MsgType type, const char* from,
const char* to, const char* id, const char* message)
| createMessage |
[static]
Create a 'message' element
Parameters:
type | Message type as enumeration |
from | The 'from' attribute |
to | The 'to' attribute |
id | The 'id' attribute |
message | The message body |
Returns: A valid XMLElement pointer
inline MsgType msgType (const char* text)
| msgType |
[static]
Get the type of a 'message' stanza
Parameters:
text | The text to check |
Returns: Message type as enumeration
inline const char* msgText (MsgType msg)
| msgText |
[static]
Get the text from a message type
Parameters:
msg | The message type |
Returns: The associated text or 0
static TokenDict s_msg[] | s_msg[] |
bool accept (JBEvent* event, bool& processed, bool& insert)
| accept |
[protected virtual]
Accept an event from the engine and process it if configured to do that
Parameters:
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 |
Returns: False if not accepted, let the engine try another service
Reimplemented from JBService.
Generated by: paulc on bussard on Wed Oct 21 01:57:30 2009, using kdoc 2.0a54. |