Files
@ d04f7e19a7f6
Branch filter:
Location: libtransport.git/backends/twitter/Requests/DirectMessageRequest.cpp - annotation
d04f7e19a7f6
947 B
text/x-c++hdr
Add FormUtils methods to make XMPP Forms handling easier to read even when keeping it portable between swiften2 and swiften3.
2b47d32a916c e9891aa2000a 2b47d32a916c e9891aa2000a 2b47d32a916c 2b47d32a916c e9891aa2000a 11937227ff60 11937227ff60 11937227ff60 11937227ff60 11937227ff60 11937227ff60 11937227ff60 2b47d32a916c 2b47d32a916c 2b47d32a916c 2b47d32a916c c236c464ffac c2fefc36c734 c236c464ffac c236c464ffac c236c464ffac c236c464ffac c236c464ffac c2fefc36c734 c236c464ffac c236c464ffac c2fefc36c734 cca74cda6862 e9891aa2000a 2b47d32a916c | #include "DirectMessageRequest.h"
DEFINE_LOGGER(logger, "DirectMessageRequest")
void DirectMessageRequest::run()
{
replyMsg = "";
if(username != "") success = twitObj->directMessageSend(username, data, false);
else success = twitObj->directMessageGet(data); /* data will contain sinceId */
if(success) {
twitObj->getLastWebResponse( replyMsg );
if(username == "" ) messages = getDirectMessages( replyMsg );
}
}
void DirectMessageRequest::finalize()
{
Error error;
if(!success) {
std::string curlerror;
twitObj->getLastCurlError(curlerror);
error.setMessage(curlerror);
LOG4CXX_ERROR(logger, user << " Curl error: " << curlerror);
callBack(user, username, messages, error);
} else {
error = getErrorMessage(replyMsg);
if(error.getMessage().length()) LOG4CXX_ERROR(logger, user << " - " << error.getMessage())
else LOG4CXX_INFO(logger, user << " - " << replyMsg)
callBack(user, username, messages, error);
}
}
|