added a mode for posting messages via XML-RPC that works better with HTML
E-mail messages
This commit is contained in:
@@ -39,12 +39,32 @@ topic = xreq.getParamTopic(3,conf);
|
||||
|
||||
if ("postMessage"==call_name)
|
||||
{ // venice:conferencing.topic.postMessage <session-id> <community> <conference> <topic> <pseud> <text>
|
||||
// [<mode>]
|
||||
// Posts a message, returns the message number within the topic
|
||||
if (xreq.paramCount!=6)
|
||||
if ((xreq.paramCount!=6) && (xreq.paramCount!=7))
|
||||
vlib.output(new XmlRpcFault(XmlRpcFault.INVALID_PARAMS,"parameter count mismatch"));
|
||||
else
|
||||
{ // post the message
|
||||
msg = topic.postNewMessage(0,xreq.getParamString(4),xreq.getParamString(5));
|
||||
{ // determine the mode
|
||||
mode = TopicContext.POST_MODE_NORMAL;
|
||||
if (xreq.paramCount==7)
|
||||
{ // interpret the posting mode
|
||||
s = xreq.getParamString(6);
|
||||
if (s.equalsIgnoreCase("normal"))
|
||||
mode = TopicContext.POST_MODE_NORMAL;
|
||||
else if (s.equalsIgnoreCase("email"))
|
||||
mode = TopicContext.POST_MODE_EMAIL;
|
||||
else
|
||||
{ // invalid mode parameter
|
||||
vlib.output(new XmlRpcFault(XmlRpcFault.INVALID_PARAMS,"invalid post mode"));
|
||||
vlib.done();
|
||||
|
||||
} // end else
|
||||
|
||||
} // end if
|
||||
// else use the default of "normal"
|
||||
|
||||
// post the message
|
||||
msg = topic.postNewMessage(0,xreq.getParamString(4),xreq.getParamString(5),mode);
|
||||
vlib.output(vlib.createInteger(msg.postNumber));
|
||||
|
||||
} // end else
|
||||
|
||||
Reference in New Issue
Block a user