From 7729fa4a4727c724df9e31cc524334f0629c558b Mon Sep 17 00:00:00 2001 From: Jeremy Lainé Date: Tue, 10 Aug 2010 09:04:12 +0000 Subject: RPC: splitting methodName should not be done at the QXmppRpcIq level, it is perfectly legitimate to not use the INTERFACE.METHOD convention in a Jabber-RPC IQ --- source/QXmppRpcIq.cpp | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) (limited to 'source/QXmppRpcIq.cpp') diff --git a/source/QXmppRpcIq.cpp b/source/QXmppRpcIq.cpp index def28458..41007312 100644 --- a/source/QXmppRpcIq.cpp +++ b/source/QXmppRpcIq.cpp @@ -369,23 +369,21 @@ void QXmppRpcInvokeIq::setArguments(const QVariantList &arguments) m_arguments = arguments; } +/// Returns the method name. +/// + QString QXmppRpcInvokeIq::method() const { return m_method; } -void QXmppRpcInvokeIq::setMethod( const QString &method ) -{ - m_method = method; -} -QString QXmppRpcInvokeIq::interface() const -{ - return m_interface; -} +/// Sets the method name. +/// +/// \param method -void QXmppRpcInvokeIq::setInterface( const QString &interface ) +void QXmppRpcInvokeIq::setMethod(const QString &method) { - m_interface = interface; + m_method = method; } bool QXmppRpcInvokeIq::isRpcInvokeIq(const QDomElement &element) @@ -401,12 +399,7 @@ void QXmppRpcInvokeIq::parseElementFromChild(const QDomElement &element) QDomElement queryElement = element.firstChildElement("query"); QDomElement methodElement = queryElement.firstChildElement("methodCall"); - const QString methodName = methodElement.firstChildElement("methodName").text(); - if (methodName.count('.') == 1) - { - m_interface = methodName.split('.').first(); - m_method = methodName.split('.').last(); - } + m_method = methodElement.firstChildElement("methodName").text(); const QDomElement methodParams = methodElement.firstChildElement("params"); m_arguments.clear(); @@ -431,7 +424,7 @@ void QXmppRpcInvokeIq::toXmlElementFromChild(QXmlStreamWriter *writer) const helperToXmlAddAttribute(writer, "xmlns", ns_rpc); writer->writeStartElement("methodCall"); - writer->writeTextElement("methodName", m_interface + "." + m_method); + writer->writeTextElement("methodName", m_method); if (!m_arguments.isEmpty()) { writer->writeStartElement("params"); -- cgit v1.2.3