diff options
author | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2014-01-22 22:03:00 (GMT) |
---|---|---|
committer | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2014-01-22 22:03:00 (GMT) |
commit | a1ad371e696289b022484c87c9d191180b132d18 (patch) | |
tree | 45c230bcd32675468d62b7bba5cd49cf4e7cdeb8 /src/uscxml/plugins/invoker | |
parent | 4206a3f8629da7005a6154912ccd690a38541930 (diff) | |
download | uscxml-a1ad371e696289b022484c87c9d191180b132d18.zip uscxml-a1ad371e696289b022484c87c9d191180b132d18.tar.gz uscxml-a1ad371e696289b022484c87c9d191180b132d18.tar.bz2 |
Ported IM Invoker for pre 3.0 and beautified code
Diffstat (limited to 'src/uscxml/plugins/invoker')
-rw-r--r-- | src/uscxml/plugins/invoker/expect/ExpectInvoker.cpp | 70 | ||||
-rw-r--r-- | src/uscxml/plugins/invoker/expect/ExpectInvoker.h | 4 | ||||
-rw-r--r-- | src/uscxml/plugins/invoker/im/IMConfig.h.in | 4 | ||||
-rw-r--r-- | src/uscxml/plugins/invoker/im/IMInvoker.cpp | 215 | ||||
-rw-r--r-- | src/uscxml/plugins/invoker/im/IMInvoker.h | 90 | ||||
-rw-r--r-- | src/uscxml/plugins/invoker/imap/IMAPInvoker.cpp | 55 | ||||
-rw-r--r-- | src/uscxml/plugins/invoker/imap/IMAPInvoker.h | 8 | ||||
-rw-r--r-- | src/uscxml/plugins/invoker/smtp/SMTPInvoker.cpp | 53 | ||||
-rw-r--r-- | src/uscxml/plugins/invoker/smtp/SMTPInvoker.h | 8 | ||||
-rw-r--r-- | src/uscxml/plugins/invoker/umundo/JSON.pb.h | 10 | ||||
-rw-r--r-- | src/uscxml/plugins/invoker/umundo/UmundoInvoker.cpp | 8 |
11 files changed, 392 insertions, 133 deletions
diff --git a/src/uscxml/plugins/invoker/expect/ExpectInvoker.cpp b/src/uscxml/plugins/invoker/expect/ExpectInvoker.cpp index 222624a..7d66b10 100644 --- a/src/uscxml/plugins/invoker/expect/ExpectInvoker.cpp +++ b/src/uscxml/plugins/invoker/expect/ExpectInvoker.cpp @@ -64,33 +64,33 @@ void ExpectInvoker::send(const SendRequest& req) { EventContext* ctx = new EventContext(); ctx->sendReq = req; ctx->instance = this; - + // LOG(ERROR) << "################ " << req; - + std::string eventId = UUID::getUUID(); _eventQueue->addEvent(eventId, ExpectInvoker::send, 0, ctx); - + // send(ctx, ""); } - + void ExpectInvoker::send(void *userdata, const std::string event) { EventContext* ctx = (EventContext*)userdata; if (!ctx) return; - + if (!ctx->instance) { delete(ctx); return; } const SendRequest& req = ctx->sendReq; - + if (iequals(req.name, "expect.match")) { int nrCases = req.params.size(); struct exp_case *cases = (struct exp_case*)malloc(sizeof(struct exp_case) * (nrCases + 1)); memset(cases, 0, sizeof(exp_case) * (nrCases + 1)); - + /** exp_end: indicates that no more patterns appear. exp_glob: indicates that the pattern is a glob-style string pattern. @@ -99,7 +99,7 @@ void ExpectInvoker::send(void *userdata, const std::string event) { exp_compiled: indicates that the pattern is a regexp-style string pattern, and that its compiled form is also provided. exp_null: indicates that the pattern is a null (for debugging purposes, a string pattern must also follow). */ - + Event::params_t::const_iterator paramIter = req.params.begin(); int index = 0; while (paramIter != req.params.end()) { @@ -119,7 +119,7 @@ void ExpectInvoker::send(void *userdata, const std::string event) { } else { expCase->type = exp_regexp; } - + expCase->pattern = strdup(paramIter->second.atom.c_str()); // LOG(ERROR) << "################ " << expCase->pattern; @@ -134,21 +134,21 @@ void ExpectInvoker::send(void *userdata, const std::string event) { paramIter++; index++; } - + assert(index == nrCases); - + cases[nrCases].type = exp_end; /** * The functions wait until the output from a process matches one of the * patterns, a specified time period has passed, or an EOF is seen. */ - + int rc = 0; // exp_fexpectv won't return on timeout when called in thread // rc = exp_fexpectv(ctx->instance->_cmdFP, cases); rc = exp_expectv(ctx->instance->_cmdFD, cases); - + if (rc == EXP_EOF) { Event ev; ev.name = "expect.match.eof"; @@ -175,7 +175,7 @@ void ExpectInvoker::send(void *userdata, const std::string event) { } if (paramIter != req.params.end()) { Event event; - + size_t colonPos = paramIter->first.find(":"); if (colonPos != std::string::npos) { std::string eventName = paramIter->first; @@ -186,7 +186,7 @@ void ExpectInvoker::send(void *userdata, const std::string event) { event.name = std::string("expect.match.") + paramIter->first; event.data.compound["type"] = Data("regex", Data::VERBATIM); } - + event.data.compound["pattern"] = Data(paramIter->second.atom, Data::VERBATIM); event.data.compound["buffer"] = Data(exp_buffer, Data::VERBATIM); event.data.compound["start"] = Data((int)(exp_match - exp_buffer)); @@ -216,7 +216,7 @@ void ExpectInvoker::send(void *userdata, const std::string event) { ctx->instance->_interpreter->getDataModel().replaceExpressions(toSend); fwrite(toSend.c_str(), toSend.length(), 1, ctx->instance->_cmdFP); } - + delete(ctx); } @@ -235,31 +235,31 @@ void ExpectInvoker::invoke(const InvokeRequest& req) { //_eventQueue->addEvent(req.sendid, ExpectInvoker::invoke, 0, ctx); invoke(ctx, ""); - + } - + void ExpectInvoker::invoke(void *userdata, const std::string event) { EventContext* ctx = (EventContext*)userdata; - + if (!ctx) return; - + if (!ctx->instance) { delete(ctx); return; } - + const InvokeRequest& req = ctx->invokeReq; - + // moved here for thread local storage if (ctx->instance->_tcl == NULL) { - ctx->instance->_tcl = Tcl_CreateInterp(); + ctx->instance->_tcl = Tcl_CreateInterp(); if (ctx->instance->_tcl) { Tcl_Init(ctx->instance->_tcl); Expect_Init(ctx->instance->_tcl); } ctx->instance->_cmdFP = NULL; - + bool debug = false; Event::getParam(req.params, "debug", debug); if (debug) { @@ -267,11 +267,11 @@ void ExpectInvoker::invoke(void *userdata, const std::string event) { } else { exp_is_debugging = 0; } - + int timeout = 20; Event::getParam(req.params, "timeout", timeout); exp_timeout = timeout; - + bool logUser = false; Event::getParam(req.params, "loguser", logUser); if (logUser) { @@ -279,12 +279,12 @@ void ExpectInvoker::invoke(void *userdata, const std::string event) { } else { exp_loguser = 0; } - + // exp_interactive = 1; exp_logfile = 0; // exp_remove_nulls = 1; // exp_ttyinit = 1; - + } else { // assert(false); } @@ -292,7 +292,7 @@ void ExpectInvoker::invoke(void *userdata, const std::string event) { char* cmd = NULL; char** args = NULL; int nrArgs = 0; - + if (req.params.count("spawn")) { // get command std::string command; @@ -314,14 +314,14 @@ void ExpectInvoker::invoke(void *userdata, const std::string event) { } args[index] = (char*)0; } else if(req.params.count("command")) { - + } - + // open socket ctx->instance->_cmdFD = exp_spawnv(cmd, args); if (ctx->instance->_cmdFD > 0) { ctx->instance->_cmdFP = fdopen(ctx->instance->_cmdFD, "r+"); - + if (ctx->instance->_cmdFP) { // disable buffering setbuf(ctx->instance->_cmdFP,(char *)0); @@ -330,7 +330,7 @@ void ExpectInvoker::invoke(void *userdata, const std::string event) { ctx->instance->returnEvent(event); } } - + if (ctx->instance->_cmdFP == NULL || ctx->instance->_cmdFD <= 0) { Event event; event.name = "spawn.failed"; @@ -345,14 +345,14 @@ void ExpectInvoker::invoke(void *userdata, const std::string event) { if (cmd) free(cmd); - + if (args) { for (int i = 0; i < nrArgs + 1; i++) { free(args[i]); } free(args); } - + } }
\ No newline at end of file diff --git a/src/uscxml/plugins/invoker/expect/ExpectInvoker.h b/src/uscxml/plugins/invoker/expect/ExpectInvoker.h index 7c9861e..902885e 100644 --- a/src/uscxml/plugins/invoker/expect/ExpectInvoker.h +++ b/src/uscxml/plugins/invoker/expect/ExpectInvoker.h @@ -57,14 +57,14 @@ public: virtual void invoke(const InvokeRequest& req); protected: - + static void send(void *userdata, const std::string event); static void invoke(void *userdata, const std::string event); static Tcl_Interp* _tcl; FILE* _cmdFP; int _cmdFD; - + DelayedEventQueue* _eventQueue; }; diff --git a/src/uscxml/plugins/invoker/im/IMConfig.h.in b/src/uscxml/plugins/invoker/im/IMConfig.h.in index e69de29..b43fef6 100644 --- a/src/uscxml/plugins/invoker/im/IMConfig.h.in +++ b/src/uscxml/plugins/invoker/im/IMConfig.h.in @@ -0,0 +1,4 @@ +#define LIBPURPLE_VERSION_MAJOR @LIBPURPLE_VERSION_MAJOR@ +#define LIBPURPLE_VERSION_MINOR @LIBPURPLE_VERSION_MINOR@ +#define LIBPURPLE_VERSION_PATCH @LIBPURPLE_VERSION_PATCH@ +#define LIBPURPLE_VERSION "@LIBPURPLE_VERSION@" diff --git a/src/uscxml/plugins/invoker/im/IMInvoker.cpp b/src/uscxml/plugins/invoker/im/IMInvoker.cpp index 23594f3..6de4063 100644 --- a/src/uscxml/plugins/invoker/im/IMInvoker.cpp +++ b/src/uscxml/plugins/invoker/im/IMInvoker.cpp @@ -116,13 +116,21 @@ PurpleConnectionUiOps IMInvoker::_uiConnectOps = { purpleConnected, purpleDisonnected, purpleNotice, +#if LIBPURPLE_VERSION_MAJOR >= 3 purpleNetworkConnected, purpleNetworkDisconnected, purpleReportDisconnect, NULL, NULL, NULL - +#else + purpleReportDisconnect, + purpleNetworkConnected, + purpleNetworkDisconnected, + NULL, + NULL, + NULL +#endif }; //libpurple conversation operations @@ -163,7 +171,7 @@ PurpleNotifyUiOps IMInvoker::_uiNotifyOps = { NULL }; -#if 0 +#if LIBPURPLE_VERSION_MAJOR < 3 PurplePrivacyUiOps IMInvoker::_uiPrivacyOps = { purplePermitAdded, purplePermitRemoved, @@ -176,8 +184,11 @@ PurplePrivacyUiOps IMInvoker::_uiPrivacyOps = { }; #endif +#if LIBPURPLE_VERSION_MAJOR >= 3 PurpleRequestFeature IMInvoker::_features; +#endif PurpleRequestUiOps IMInvoker::_uiRequestOps = { +#if LIBPURPLE_VERSION_MAJOR >= 3 _features, purpleRequestInput, purpleRequestChoice, @@ -192,6 +203,21 @@ PurpleRequestUiOps IMInvoker::_uiRequestOps = { NULL, NULL, NULL +#else + purpleRequestInput, + purpleRequestChoice, + purpleRequestAction, + purpleRequestFields, + purpleRequestFile, + purpleRequestClose, + purpleRequestFolder, + purpleRequestActionWithIcon, + NULL, + NULL, + NULL + +#endif + }; PurpleWhiteboardUiOps IMInvoker::_uiWhiteboardOps = { @@ -447,16 +473,16 @@ Data IMInvoker::statusToData(PurpleStatus *status) { const char* statusName = purple_status_get_name(status); if (statusName) data.compound["name"] = Data(statusName, Data::VERBATIM); - PurpleStatusType* statusType = purple_status_get_status_type(status); + PurpleStatusType* statusType = PURPLE_STATUS_GET_TYPE(status); GList *statusAttrElem; - PurpleStatusAttribute* statusAttr; + PURPLE_STATUS_ATTR* statusAttr; GList *statusAttrList = purple_status_type_get_attrs(statusType); for(statusAttrElem = statusAttrList; statusAttrElem; statusAttrElem = statusAttrElem->next) { - statusAttr = (PurpleStatusAttribute*)statusAttrElem->data; - const char* statusAttrId = purple_status_attribute_get_id(statusAttr); - GValue* statusValue = purple_status_get_attr_value(status, statusAttrId); + statusAttr = (PURPLE_STATUS_ATTR*)statusAttrElem->data; + const char* statusAttrId = PURPLE_STATUS_ATTR_GET_ID(statusAttr); + PURPLE_VALUE* statusValue = purple_status_get_attr_value(status, statusAttrId); if (statusValue) { data.compound[statusAttrId] = purpleValueToData(statusValue); } @@ -510,15 +536,15 @@ Data IMInvoker::buddyToData(PurpleBuddy *buddy) { continue; data.compound["status"].compound[statusId] = statusToData(status); } - } return data; } -Data IMInvoker::purpleValueToData(GValue* value) { +Data IMInvoker::purpleValueToData(PURPLE_VALUE* value) { Data data; +#if LIBPURPLE_VERSION_MAJOR >= 3 if (false) { } else if (g_type_check_value_holds(value, G_TYPE_CHAR)) { data = Data(g_value_get_schar(value), Data::VERBATIM); @@ -567,6 +593,58 @@ Data IMInvoker::purpleValueToData(GValue* value) { } else { LOG(ERROR) << "purple thingy unknown"; } +#else + switch (purple_value_get_type(value)) { + case PURPLE_TYPE_BOOLEAN: + if (purple_value_get_boolean(value)) + data = Data("true"); + data = Data("false"); + break; + case PURPLE_TYPE_STRING: + if (purple_value_get_string(value)) { + data = Data(purple_value_get_string(value), Data::VERBATIM); + } + break; + case PURPLE_TYPE_CHAR: + Data(purple_value_get_char(value)); + break; + case PURPLE_TYPE_UCHAR: + Data(purple_value_get_uchar(value)); + break; + case PURPLE_TYPE_SHORT: + Data(purple_value_get_short(value)); + break; + case PURPLE_TYPE_USHORT: + Data(purple_value_get_ushort(value)); + break; + case PURPLE_TYPE_INT: + Data(purple_value_get_int(value)); + break; + case PURPLE_TYPE_UINT: + Data(purple_value_get_uint(value)); + break; + case PURPLE_TYPE_LONG: + Data(purple_value_get_long(value)); + break; + case PURPLE_TYPE_ULONG: + Data(purple_value_get_ulong(value)); + break; + case PURPLE_TYPE_INT64: + Data(purple_value_get_int64(value)); + break; + case PURPLE_TYPE_UINT64: + Data(purple_value_get_uint64(value)); + break; + case PURPLE_TYPE_OBJECT: + case PURPLE_TYPE_POINTER: + case PURPLE_TYPE_ENUM: + case PURPLE_TYPE_BOXED: + case PURPLE_TYPE_UNKNOWN: + case PURPLE_TYPE_SUBTYPE: + LOG(ERROR) << "purple thingy not supported"; + break; + } +#endif return data; } @@ -634,10 +712,16 @@ void IMInvoker::send(void *userdata, const std::string event) { Data data; Event::getParam(ctx->sendReq.params, "data", data); +#if LIBPURPLE_VERSION_MAJOR >= 3 PurpleIMConversation* conv = purple_im_conversation_new(ctx->instance->_account, receiver.c_str()); if (ctx->sendReq.content.length() > 0) purple_conversation_send(PURPLE_CONVERSATION(conv), ctx->sendReq.content.c_str()); - +#else + PurpleConversation* conv = purple_conversation_new(PURPLE_CONV_TYPE_IM, ctx->instance->_account, receiver.c_str()); + if (ctx->sendReq.content.length() > 0) + purple_conv_im_send(purple_conversation_get_im_data(conv), ctx->sendReq.content.c_str()); +#endif + #if 0 if (data.binary) { PurpleConnection *gc = purple_account_get_connection(ctx->instance->_account); @@ -681,17 +765,28 @@ void IMInvoker::send(void *userdata, const std::string event) { PurpleBuddy* buddy = purple_buddy_new(ctx->instance->_account, buddyName.c_str(), NULL); purple_blist_add_buddy(buddy, NULL, NULL, NULL); +#if LIBPURPLE_VERSION_MAJOR >= 3 purple_account_add_buddy(ctx->instance->_account, buddy, reqMsg.c_str()); - +#else + purple_account_add_buddy(ctx->instance->_account, buddy); +#endif + } else if (iequals(ctx->sendReq.name, "im.buddy.remove")) { std::string buddyName; Event::getParam(ctx->sendReq.params, "name", buddyName); +#if LIBPURPLE_VERSION_MAJOR >= 3 PurpleBuddy* buddy = purple_blist_find_buddy(ctx->instance->_account, buddyName.c_str()); if (PURPLE_IS_BUDDY(buddy)) { purple_account_remove_buddy(ctx->instance->_account, buddy, purple_buddy_get_group(buddy)); purple_blist_remove_buddy(buddy); } +#else + PurpleBuddy* buddy = purple_find_buddy(ctx->instance->_account, buddyName.c_str()); + purple_account_remove_buddy(ctx->instance->_account, buddy, purple_buddy_get_group(buddy)); + purple_blist_remove_buddy(buddy); + +#endif } delete(ctx); @@ -725,7 +820,11 @@ void IMInvoker::invoke(void *userdata, const std::string event) { instance->_account = purple_account_new(username.c_str(), protocolId.c_str()); _accountInstances[instance->_account] = instance; +#if LIBPURPLE_VERSION_MAJOR >= 3 purple_account_set_password(instance->_account, password.c_str(), NULL, NULL); +#else + purple_account_set_password(instance->_account, password.c_str()); +#endif purple_account_set_enabled(instance->_account, "uscxml", true); GSList* buddies = purple_blist_get_buddies(); @@ -903,7 +1002,11 @@ void* IMInvoker::accountRequestAuthorize(PurpleAccount *account, PurpleAccountRequestAuthorizationCb deny_cb, void *user_data) { // always accept all "may I add you as a buddy?" requests +#if LIBPURPLE_VERSION_MAJOR >= 3 authorize_cb(message, user_data); +#else + authorize_cb(user_data); +#endif return user_data; } @@ -1093,7 +1196,11 @@ void IMInvoker::purpleAddThumbnail(PurpleXfer *xfer, const gchar *formats) { } // notification operations +#if LIBPURPLE_VERSION_MAJOR >= 3 void* IMInvoker::purpeNotifyMessage(PurpleNotifyMsgType type, const char *title, const char *primary, const char *secondary, PurpleRequestCommonParameters *cpar) { +#else +void* IMInvoker::purpeNotifyMessage(PurpleNotifyMsgType type, const char *title, const char *primary, const char *secondary) { +#endif return NULL; } void* IMInvoker::purpeNotifyEmail(PurpleConnection *gc, const char *subject, const char *from, const char *to, const char *url) { @@ -1125,6 +1232,8 @@ void IMInvoker::purpleDenyRemoved(PurpleAccount *account, const char *name) {} // request ui operations +#if LIBPURPLE_VERSION_MAJOR >= 3 + void* IMInvoker::purpleRequestInput(const char *title, const char *primary, const char *secondary, const char *default_value, gboolean multiline, gboolean masked, gchar *hint, @@ -1136,7 +1245,7 @@ void* IMInvoker::purpleRequestInput(const char *title, const char *primary, void* IMInvoker::purpleRequestChoice(const char *title, const char *primary, const char *secondary, gpointer default_value, const char *ok_text, GCallback ok_cb, const char *cancel_text, - GCallback cancel_cb, PurpleRequestCommonParameters *cpar, + GCallback cancel_cb , PurpleRequestCommonParameters *cpar, void *user_data, va_list choices) { return NULL; } @@ -1146,6 +1255,7 @@ void* IMInvoker::purpleRequestAction(const char *title, const char *primary, size_t action_count, va_list actions) { return NULL; } + void* IMInvoker::purpleRequestWait(const char *title, const char *primary, const char *secondary, gboolean with_progress, PurpleRequestCancelCb cancel_cb, @@ -1154,8 +1264,8 @@ void* IMInvoker::purpleRequestWait(const char *title, const char *primary, } void IMInvoker::purpleRequestWaitUpdate(void *ui_handle, gboolean pulse, gfloat fraction) { - } + void* IMInvoker::purpleRequestFields(const char *title, const char *primary, const char *secondary, PurpleRequestFields *fields, const char *ok_text, GCallback ok_cb, @@ -1182,14 +1292,82 @@ void* IMInvoker::purpleRequestFile(const char *title, const char *filename, } void* IMInvoker::purpleRequestFolder(const char *title, const char *dirname, - GCallback ok_cb, GCallback cancel_cb, - PurpleRequestCommonParameters *cpar, void *user_data) { + GCallback ok_cb, GCallback cancel_cb + , PurpleRequestCommonParameters *cpar, void *user_data) { return NULL; } void IMInvoker::purpleRequestClose(PurpleRequestType type, void *ui_handle) { } +#else + +void* IMInvoker::purpleRequestInput(const char *title, const char *primary, + const char *secondary, const char *default_value, + gboolean multiline, gboolean masked, gchar *hint, + const char *ok_text, GCallback ok_cb, + const char *cancel_text, GCallback cancel_cb, + PurpleAccount *account, const char *who, + PurpleConversation *conv, void *user_data) { + return NULL; +} + +void* IMInvoker::purpleRequestChoice(const char *title, const char *primary, + const char *secondary, int default_value, + const char *ok_text, GCallback ok_cb, + const char *cancel_text, GCallback cancel_cb, + PurpleAccount *account, const char *who, + PurpleConversation *conv, void *user_data, + va_list choices) { + return NULL; +} + +void* IMInvoker::purpleRequestAction(const char *title, const char *primary, + const char *secondary, int default_action, + PurpleAccount *account, const char *who, + PurpleConversation *conv, void *user_data, + size_t action_count, va_list actions) { + return NULL; +} + +void* IMInvoker::purpleRequestFields(const char *title, const char *primary, + const char *secondary, PurpleRequestFields *fields, + const char *ok_text, GCallback ok_cb, + const char *cancel_text, GCallback cancel_cb, + PurpleAccount *account, const char *who, + PurpleConversation *conv, void *user_data) { + return NULL; +} + +void* IMInvoker::purpleRequestFile(const char *title, const char *filename, + gboolean savedialog, GCallback ok_cb, + GCallback cancel_cb, PurpleAccount *account, + const char *who, PurpleConversation *conv, + void *user_data) { + return NULL; +} + +void IMInvoker::purpleRequestClose(PurpleRequestType type, void *ui_handle) { +} + +void* IMInvoker::purpleRequestFolder(const char *title, const char *dirname, + GCallback ok_cb, GCallback cancel_cb, + PurpleAccount *account, const char *who, + PurpleConversation *conv, void *user_data) { + return NULL; +} + +void* IMInvoker::purpleRequestActionWithIcon(const char *title, const char *primary, + const char *secondary, int default_action, + PurpleAccount *account, const char *who, + PurpleConversation *conv, + gconstpointer icon_data, gsize icon_size, + void *user_data, + size_t action_count, va_list actions) { + return NULL; +} + +#endif // connection ui operations @@ -1199,8 +1377,13 @@ void IMInvoker::purpleDisonnected(PurpleConnection *gc) {} void IMInvoker::purpleNotice(PurpleConnection *gc, const char *text) {} void IMInvoker::purpleNetworkConnected(void) {} void IMInvoker::purpleNetworkDisconnected(void) {} -void IMInvoker::purpleReportDisconnect(PurpleConnection *gc, PurpleConnectionError reason, const char *text) {} +#if LIBPURPLE_VERSION_MAJOR >= 3 +void IMInvoker::purpleReportDisconnect(PurpleConnection *gc, PurpleConnectionError reason, const char *text) { +#else +void IMInvoker::purpleReportDisconnect(PurpleConnection *gc, const char *text) { +#endif +} // whiteboard ui operations void IMInvoker::purpleCreateWB(PurpleWhiteboard *wb) {} void IMInvoker::purpleDestroyWB(PurpleWhiteboard *wb) {} diff --git a/src/uscxml/plugins/invoker/im/IMInvoker.h b/src/uscxml/plugins/invoker/im/IMInvoker.h index cb7032b..a3f129a 100644 --- a/src/uscxml/plugins/invoker/im/IMInvoker.h +++ b/src/uscxml/plugins/invoker/im/IMInvoker.h @@ -28,6 +28,18 @@ extern "C" { #include "uscxml/IMConfig.h" +#if LIBPURPLE_VERSION_MAJOR < 3 +#define PURPLE_STATUS_GET_TYPE purple_status_get_type +#define PURPLE_STATUS_ATTR_GET_ID purple_status_attr_get_id +#define PURPLE_STATUS_ATTR PurpleStatusAttr +#define PURPLE_VALUE PurpleValue +#else +#define PURPLE_STATUS_GET_TYPE purple_status_get_status_type +#define PURPLE_STATUS_ATTR_GET_ID purple_status_attribute_get_id +#define PURPLE_STATUS_ATTR PurpleStatusAttribute +#define PURPLE_VALUE GValue +#endif + #ifdef BUILD_AS_PLUGINS #include "uscxml/plugins/Plugins.h" #endif @@ -81,7 +93,7 @@ private: static Data buddyToData(PurpleBuddy *buddy); static Data statusToData(PurpleStatus *status); - static Data purpleValueToData(GValue* value); + static Data purpleValueToData(PURPLE_VALUE* value); static PurpleAccountUiOps _uiAccountOps; static PurpleEventLoopUiOps _uiEventLoopOps; @@ -90,13 +102,18 @@ private: static PurpleBlistUiOps _uiBuddyOps; static PurpleXferUiOps _uiXferOps; static PurpleNotifyUiOps _uiNotifyOps; -// static PurplePrivacyUiOps _uiPrivacyOps; +#if LIBPURPLE_VERSION_MAJOR < 3 + static PurplePrivacyUiOps _uiPrivacyOps; +#endif static PurpleRequestUiOps _uiRequestOps; static PurpleConnectionUiOps _uiConnectOps; static PurpleWhiteboardUiOps _uiWhiteboardOps; static PurpleDebugUiOps _uiDebugOps; +#if LIBPURPLE_VERSION_MAJOR >= 3 static PurpleRequestFeature _features; +#endif + static GHashTable* _uiInfo; static GRand* _gRand; @@ -205,7 +222,11 @@ private: static void purpleAddThumbnail(PurpleXfer *xfer, const gchar *formats); // notification operations - static void* purpeNotifyMessage(PurpleNotifyMsgType type, const char *title, const char *primary, const char *secondary, PurpleRequestCommonParameters *cpar); +#if LIBPURPLE_VERSION_MAJOR >= 3 + static void* purpeNotifyMessage(PurpleNotifyMsgType type, const char *title, const char *primary, const char *secondary , PurpleRequestCommonParameters *cpar); +#else + static void* purpeNotifyMessage(PurpleNotifyMsgType type, const char *title, const char *primary, const char *secondary); +#endif static void* purpeNotifyEmail(PurpleConnection *gc, const char *subject, const char *from, const char *to, const char *url); static void* purpeNotifyEmails(PurpleConnection *gc, size_t count, gboolean detailed, const char **subjects, const char **froms, const char **tos, const char **urls); static void* purpeNotifyFormatted(const char *title, const char *primary, const char *secondary, const char *text); @@ -229,6 +250,8 @@ private: static void purpleDenyRemoved(PurpleAccount *account, const char *name); // request ui operations +#if LIBPURPLE_VERSION_MAJOR >= 3 + static void* purpleRequestInput(const char *title, const char *primary, const char *secondary, const char *default_value, gboolean multiline, gboolean masked, gchar *hint, @@ -238,7 +261,7 @@ private: static void* purpleRequestChoice(const char *title, const char *primary, const char *secondary, gpointer default_value, const char *ok_text, GCallback ok_cb, const char *cancel_text, - GCallback cancel_cb, PurpleRequestCommonParameters *cpar, + GCallback cancel_cb , PurpleRequestCommonParameters *cpar, void *user_data, va_list choices); static void* purpleRequestAction(const char *title, const char *primary, const char *secondary, int default_action, @@ -250,6 +273,7 @@ private: PurpleRequestCommonParameters *cpar, void *user_data); static void purpleRequestWaitUpdate(void *ui_handle, gboolean pulse, gfloat fraction); + static void* purpleRequestFields(const char *title, const char *primary, const char *secondary, PurpleRequestFields *fields, const char *ok_text, GCallback ok_cb, @@ -262,6 +286,59 @@ private: GCallback ok_cb, GCallback cancel_cb, PurpleRequestCommonParameters *cpar, void *user_data); static void purpleRequestClose(PurpleRequestType type, void *ui_handle); +#else + + static void* purpleRequestInput(const char *title, const char *primary, + const char *secondary, const char *default_value, + gboolean multiline, gboolean masked, gchar *hint, + const char *ok_text, GCallback ok_cb, + const char *cancel_text, GCallback cancel_cb, + PurpleAccount *account, const char *who, + PurpleConversation *conv, void *user_data); + + static void* purpleRequestChoice(const char *title, const char *primary, + const char *secondary, int default_value, + const char *ok_text, GCallback ok_cb, + const char *cancel_text, GCallback cancel_cb, + PurpleAccount *account, const char *who, + PurpleConversation *conv, void *user_data, + va_list choices); + + static void* purpleRequestAction(const char *title, const char *primary, + const char *secondary, int default_action, + PurpleAccount *account, const char *who, + PurpleConversation *conv, void *user_data, + size_t action_count, va_list actions); + + static void* purpleRequestFields(const char *title, const char *primary, + const char *secondary, PurpleRequestFields *fields, + const char *ok_text, GCallback ok_cb, + const char *cancel_text, GCallback cancel_cb, + PurpleAccount *account, const char *who, + PurpleConversation *conv, void *user_data); + + static void* purpleRequestFile(const char *title, const char *filename, + gboolean savedialog, GCallback ok_cb, + GCallback cancel_cb, PurpleAccount *account, + const char *who, PurpleConversation *conv, + void *user_data); + + static void purpleRequestClose(PurpleRequestType type, void *ui_handle); + + static void* purpleRequestFolder(const char *title, const char *dirname, + GCallback ok_cb, GCallback cancel_cb, + PurpleAccount *account, const char *who, + PurpleConversation *conv, void *user_data); + + static void* purpleRequestActionWithIcon(const char *title, const char *primary, + const char *secondary, int default_action, + PurpleAccount *account, const char *who, + PurpleConversation *conv, + gconstpointer icon_data, gsize icon_size, + void *user_data, + size_t action_count, va_list actions); + +#endif // connection ui operations @@ -271,8 +348,11 @@ private: static void purpleNotice(PurpleConnection *gc, const char *text); static void purpleNetworkConnected(void); static void purpleNetworkDisconnected(void); +#if LIBPURPLE_VERSION_MAJOR >= 3 static void purpleReportDisconnect(PurpleConnection *gc, PurpleConnectionError reason, const char *text); - +#else + static void purpleReportDisconnect(PurpleConnection *gc, const char *text); +#endif // whiteboard ui operations static void purpleCreateWB(PurpleWhiteboard *wb); diff --git a/src/uscxml/plugins/invoker/imap/IMAPInvoker.cpp b/src/uscxml/plugins/invoker/imap/IMAPInvoker.cpp index 22e32da..ffe00a9 100644 --- a/src/uscxml/plugins/invoker/imap/IMAPInvoker.cpp +++ b/src/uscxml/plugins/invoker/imap/IMAPInvoker.cpp @@ -61,16 +61,16 @@ size_t IMAPInvoker::writeCurlData(void *ptr, size_t size, size_t nmemb, void *us size_t toWrite = std::min(ctx->content.length() - ctx->readPtr, size * nmemb); if (toWrite > 0) { - memcpy (ptr, ctx->content.c_str() + ctx->readPtr, toWrite); + memcpy (ptr, ctx->content.c_str() + ctx->readPtr, toWrite); ctx->readPtr += toWrite; } - + return toWrite; } std::list<std::string> IMAPInvoker::getAtoms(std::list<Data> list) { std::list<std::string> atoms; - + std::list<Data>::const_iterator iter = list.begin(); while(iter != list.end()) { const Data& data = *iter; @@ -106,7 +106,7 @@ void IMAPInvoker::getAttachments(std::list<Data> list, std::list<Data>& attachme att.compound["mimetype"] = Data("text/plain", Data::VERBATIM); } } - + if (!att.hasKey("filename")) { std::stringstream filenameSS; filenameSS << "attachment" << attachments.size() + 1; @@ -119,19 +119,19 @@ void IMAPInvoker::getAttachments(std::list<Data> list, std::list<Data>& attachme } attachments.push_back(att); - + } else if (data.binary) { // a single binary blob Data att; att.compound["data"].binary = data.binary; - + if (data.binary->mimeType.size() > 0) { att.compound["mimetype"] = Data(attachments.back()["data"].binary->mimeType, Data::VERBATIM); } else { att.compound["mimetype"] = Data("application/octet-stream", Data::VERBATIM); } - + std::stringstream filenameSS; filenameSS << "attachment" << attachments.size() + 1; if (boost::starts_with(att.compound["mimetype"].atom, "text")) { @@ -140,7 +140,7 @@ void IMAPInvoker::getAttachments(std::list<Data> list, std::list<Data>& attachme filenameSS << ".bin"; } att.compound["filename"] = Data(filenameSS.str(), Data::VERBATIM); - + attachments.push_back(att); } else if (data.compound.size() > 0) { @@ -159,10 +159,10 @@ void IMAPInvoker::getAttachments(std::list<Data> list, std::list<Data>& attachme iter++; } } - + void IMAPInvoker::send(const SendRequest& req) { if (iequals(req.name, "mail.send")) { - + struct curl_slist* recipients = NULL; CURLcode curlError; std::string multipartSep; @@ -177,7 +177,7 @@ void IMAPInvoker::send(const SendRequest& req) { std::list<Data> ccParams; std::list<Data> bccParams; std::list<Data> attachmentParams; - + Event::getParam(req.params, "verbose", verbose); Event::getParam(req.params, "ssl", useSSL); Event::getParam(req.params, "Content-Type", contentType); @@ -191,7 +191,7 @@ void IMAPInvoker::send(const SendRequest& req) { if (contentType.size() == 0) contentType = "text/plain; charset=\"UTF-8\""; - + IMAPContext* ctx = new IMAPContext(); std::stringstream contentSS; @@ -200,11 +200,12 @@ void IMAPInvoker::send(const SendRequest& req) { std::list<std::string> cc = getAtoms(ccParams); std::list<std::string> bcc = getAtoms(bccParams); std::list<std::string> headers = getAtoms(headerParams); - std::list<Data> attachments; getAttachments(attachmentParams, attachments); + std::list<Data> attachments; + getAttachments(attachmentParams, attachments); if (to.size() == 0) return; - + recIter = to.begin(); recIter++; // skip first as we need it in CURLOPT_MAIL_RCPT while(recIter != to.end()) { @@ -235,7 +236,7 @@ void IMAPInvoker::send(const SendRequest& req) { boost::replace_all(subject, "\r", " "); contentSS << "Subject: " << subject << "\n"; } - + // content type is different when we have attachments if (attachments.size() > 0) { multipartSep = UUID::getUUID(); @@ -249,10 +250,10 @@ void IMAPInvoker::send(const SendRequest& req) { // when we have no attachment, respect user-defined or use text/plain contentSS << "Content-Type: " << contentType << "\n"; } - + contentSS << "\n"; contentSS << req.content; - + std::list<Data>::iterator attIter = attachments.begin(); while(attIter != attachments.end()) { // only send valid attachments @@ -263,7 +264,7 @@ void IMAPInvoker::send(const SendRequest& req) { contentSS << "--" << multipartSep << "\n"; contentSS << "Content-Disposition: attachment; filename=\"" << attIter->compound["filename"].atom << "\""; contentSS << "\n"; - + contentSS << "Content-Type: " << attIter->compound["mimetype"].atom << "; "; contentSS << "name=\"" << attIter->compound["filename"].atom << "\""; contentSS << "\n"; @@ -280,10 +281,10 @@ void IMAPInvoker::send(const SendRequest& req) { } attIter++; } - + ctx->content = contentSS.str(); ctx->invoker = this; - + // see http://curl.haxx.se/libcurl/c/imap-tls.html _curl = curl_easy_init(); @@ -294,7 +295,7 @@ void IMAPInvoker::send(const SendRequest& req) { LOG(ERROR) << "Cannot set password: " << curl_easy_strerror(curlError); (curlError = curl_easy_setopt(_curl, CURLOPT_URL, _server.c_str())) == CURLE_OK || LOG(ERROR) << "Cannot set server string: " << curl_easy_strerror(curlError); - + if (useSSL) { (curlError = curl_easy_setopt(_curl, CURLOPT_USE_SSL, (long)CURLUSESSL_ALL)) == CURLE_OK || LOG(ERROR) << "Cannot use SSL: " << curl_easy_strerror(curlError); @@ -309,12 +310,12 @@ void IMAPInvoker::send(const SendRequest& req) { #endif } - + // this is needed, even if we have a callback function recipients = curl_slist_append(recipients, to.begin()->c_str()); (curlError = curl_easy_setopt(_curl, CURLOPT_MAIL_RCPT, recipients)) == CURLE_OK || LOG(ERROR) << "Cannot set mail recipient: " << curl_easy_strerror(curlError); - + (curlError = curl_easy_setopt(_curl, CURLOPT_READFUNCTION, IMAPInvoker::writeCurlData)) == CURLE_OK || LOG(ERROR) << "Cannot register read function: " << curl_easy_strerror(curlError); (curlError = curl_easy_setopt(_curl, CURLOPT_READDATA, ctx)) == CURLE_OK || @@ -326,16 +327,16 @@ void IMAPInvoker::send(const SendRequest& req) { (curlError = curl_easy_setopt(_curl, CURLOPT_MAIL_FROM, from.c_str())) == CURLE_OK || LOG(ERROR) << "Cannot set from parameter: " << curl_easy_strerror(curlError); } - + if (verbose) { (curlError = curl_easy_setopt(_curl, CURLOPT_VERBOSE, 1L)) == CURLE_OK || LOG(ERROR) << "Cannot set curl to verbose: " << curl_easy_strerror(curlError); } CURLcode res = curl_easy_perform(_curl); - + /* Check for errors */ - if(res != CURLE_OK){ + if(res != CURLE_OK) { LOG(ERROR) << "curl_easy_perform() failed: " << curl_easy_strerror(res); returnErrorExecution("error.mail.send"); } else { @@ -344,7 +345,7 @@ void IMAPInvoker::send(const SendRequest& req) { /* Free the list of recipients */ if (recipients) curl_slist_free_all(recipients); - + /* Always cleanup */ curl_easy_cleanup(_curl); diff --git a/src/uscxml/plugins/invoker/imap/IMAPInvoker.h b/src/uscxml/plugins/invoker/imap/IMAPInvoker.h index b772bdd..5ffa727 100644 --- a/src/uscxml/plugins/invoker/imap/IMAPInvoker.h +++ b/src/uscxml/plugins/invoker/imap/IMAPInvoker.h @@ -49,20 +49,20 @@ public: virtual void invoke(const InvokeRequest& req); protected: - + class IMAPContext { public: IMAPContext() : readPtr(0) {} std::string content; - size_t readPtr; + size_t readPtr; IMAPInvoker* invoker; }; - + CURL* _curl; std::string _username; std::string _password; std::string _server; - + std::list<std::string> getAtoms(std::list<Data> list); void getAttachments(std::list<Data> list, std::list<Data>& attachments); static size_t writeCurlData(void *ptr, size_t size, size_t nmemb, void *userdata); diff --git a/src/uscxml/plugins/invoker/smtp/SMTPInvoker.cpp b/src/uscxml/plugins/invoker/smtp/SMTPInvoker.cpp index 9234fc5..3e130a0 100644 --- a/src/uscxml/plugins/invoker/smtp/SMTPInvoker.cpp +++ b/src/uscxml/plugins/invoker/smtp/SMTPInvoker.cpp @@ -61,16 +61,16 @@ size_t SMTPInvoker::writeCurlData(void *ptr, size_t size, size_t nmemb, void *us size_t toWrite = std::min(ctx->content.length() - ctx->readPtr, size * nmemb); if (toWrite > 0) { - memcpy (ptr, ctx->content.c_str() + ctx->readPtr, toWrite); + memcpy (ptr, ctx->content.c_str() + ctx->readPtr, toWrite); ctx->readPtr += toWrite; } - + return toWrite; } std::list<std::string> SMTPInvoker::getAtoms(std::list<Data> list) { std::list<std::string> atoms; - + std::list<Data>::const_iterator iter = list.begin(); while(iter != list.end()) { const Data& data = *iter; @@ -106,7 +106,7 @@ void SMTPInvoker::getAttachments(std::list<Data> list, std::list<Data>& attachme att.compound["mimetype"] = Data("text/plain", Data::VERBATIM); } } - + if (!att.hasKey("filename")) { std::stringstream filenameSS; filenameSS << "attachment" << attachments.size() + 1; @@ -119,19 +119,19 @@ void SMTPInvoker::getAttachments(std::list<Data> list, std::list<Data>& attachme } attachments.push_back(att); - + } else if (data.binary) { // a single binary blob Data att; att.compound["data"].binary = data.binary; - + if (data.binary->mimeType.size() > 0) { att.compound["mimetype"] = Data(attachments.back()["data"].binary->mimeType, Data::VERBATIM); } else { att.compound["mimetype"] = Data("application/octet-stream", Data::VERBATIM); } - + std::stringstream filenameSS; filenameSS << "attachment" << attachments.size() + 1; if (boost::starts_with(att.compound["mimetype"].atom, "text")) { @@ -140,7 +140,7 @@ void SMTPInvoker::getAttachments(std::list<Data> list, std::list<Data>& attachme filenameSS << ".bin"; } att.compound["filename"] = Data(filenameSS.str(), Data::VERBATIM); - + attachments.push_back(att); } else if (data.compound.size() > 0) { @@ -159,10 +159,10 @@ void SMTPInvoker::getAttachments(std::list<Data> list, std::list<Data>& attachme iter++; } } - + void SMTPInvoker::send(const SendRequest& req) { if (iequals(req.name, "mail.send")) { - + struct curl_slist* recipients = NULL; CURLcode curlError; std::string multipartSep; @@ -176,7 +176,7 @@ void SMTPInvoker::send(const SendRequest& req) { std::list<Data> ccParams; std::list<Data> bccParams; std::list<Data> attachmentParams; - + Event::getParam(req.params, "verbose", verbose); Event::getParam(req.params, "Content-Type", contentType); Event::getParam(req.params, "attachment", attachmentParams); @@ -189,7 +189,7 @@ void SMTPInvoker::send(const SendRequest& req) { if (contentType.size() == 0) contentType = "text/plain; charset=\"UTF-8\""; - + SMTPContext* ctx = new SMTPContext(); std::stringstream contentSS; @@ -198,11 +198,12 @@ void SMTPInvoker::send(const SendRequest& req) { std::list<std::string> cc = getAtoms(ccParams); std::list<std::string> bcc = getAtoms(bccParams); std::list<std::string> headers = getAtoms(headerParams); - std::list<Data> attachments; getAttachments(attachmentParams, attachments); + std::list<Data> attachments; + getAttachments(attachmentParams, attachments); if (to.size() == 0) return; - + recIter = to.begin(); recIter++; // skip first as we need it in CURLOPT_MAIL_RCPT while(recIter != to.end()) { @@ -233,7 +234,7 @@ void SMTPInvoker::send(const SendRequest& req) { boost::replace_all(subject, "\r", " "); contentSS << "Subject: " << subject << "\n"; } - + // content type is different when we have attachments if (attachments.size() > 0) { multipartSep = UUID::getUUID(); @@ -247,10 +248,10 @@ void SMTPInvoker::send(const SendRequest& req) { // when we have no attachment, respect user-defined or use text/plain contentSS << "Content-Type: " << contentType << "\n"; } - + contentSS << "\n"; contentSS << req.content; - + std::list<Data>::iterator attIter = attachments.begin(); while(attIter != attachments.end()) { // only send valid attachments @@ -261,7 +262,7 @@ void SMTPInvoker::send(const SendRequest& req) { contentSS << "--" << multipartSep << "\n"; contentSS << "Content-Disposition: attachment; filename=\"" << attIter->compound["filename"].atom << "\""; contentSS << "\n"; - + contentSS << "Content-Type: " << attIter->compound["mimetype"].atom << "; "; contentSS << "name=\"" << attIter->compound["filename"].atom << "\""; contentSS << "\n"; @@ -278,10 +279,10 @@ void SMTPInvoker::send(const SendRequest& req) { } attIter++; } - + ctx->content = contentSS.str(); ctx->invoker = this; - + // see http://curl.haxx.se/libcurl/c/smtp-tls.html _curl = curl_easy_init(); @@ -294,12 +295,12 @@ void SMTPInvoker::send(const SendRequest& req) { LOG(ERROR) << "Cannot set server string: " << curl_easy_strerror(curlError); (curlError = curl_easy_setopt(_curl, CURLOPT_USE_SSL, (long)CURLUSESSL_ALL)) == CURLE_OK || LOG(ERROR) << "Cannot use SSL: " << curl_easy_strerror(curlError); - + // this is needed, even if we have a callback function recipients = curl_slist_append(recipients, to.begin()->c_str()); (curlError = curl_easy_setopt(_curl, CURLOPT_MAIL_RCPT, recipients)) == CURLE_OK || LOG(ERROR) << "Cannot set mail recipient: " << curl_easy_strerror(curlError); - + (curlError = curl_easy_setopt(_curl, CURLOPT_READFUNCTION, SMTPInvoker::writeCurlData)) == CURLE_OK || LOG(ERROR) << "Cannot register read function: " << curl_easy_strerror(curlError); (curlError = curl_easy_setopt(_curl, CURLOPT_READDATA, ctx)) == CURLE_OK || @@ -321,16 +322,16 @@ void SMTPInvoker::send(const SendRequest& req) { (curlError = curl_easy_setopt(_curl, CURLOPT_MAIL_FROM, from.c_str())) == CURLE_OK || LOG(ERROR) << "Cannot set from parameter: " << curl_easy_strerror(curlError); } - + if (verbose) { (curlError = curl_easy_setopt(_curl, CURLOPT_VERBOSE, 1L)) == CURLE_OK || LOG(ERROR) << "Cannot set curl to verbose: " << curl_easy_strerror(curlError); } CURLcode res = curl_easy_perform(_curl); - + /* Check for errors */ - if(res != CURLE_OK){ + if(res != CURLE_OK) { LOG(ERROR) << "curl_easy_perform() failed: " << curl_easy_strerror(res); returnErrorExecution("error.mail.send"); } else { @@ -339,7 +340,7 @@ void SMTPInvoker::send(const SendRequest& req) { /* Free the list of recipients */ if (recipients) curl_slist_free_all(recipients); - + /* Always cleanup */ curl_easy_cleanup(_curl); diff --git a/src/uscxml/plugins/invoker/smtp/SMTPInvoker.h b/src/uscxml/plugins/invoker/smtp/SMTPInvoker.h index 1167153..2ae5482 100644 --- a/src/uscxml/plugins/invoker/smtp/SMTPInvoker.h +++ b/src/uscxml/plugins/invoker/smtp/SMTPInvoker.h @@ -49,20 +49,20 @@ public: virtual void invoke(const InvokeRequest& req); protected: - + class SMTPContext { public: SMTPContext() : readPtr(0) {} std::string content; - size_t readPtr; + size_t readPtr; SMTPInvoker* invoker; }; - + CURL* _curl; std::string _username; std::string _password; std::string _server; - + std::list<std::string> getAtoms(std::list<Data> list); void getAttachments(std::list<Data> list, std::list<Data>& attachments); static size_t writeCurlData(void *ptr, size_t size, size_t nmemb, void *userdata); diff --git a/src/uscxml/plugins/invoker/umundo/JSON.pb.h b/src/uscxml/plugins/invoker/umundo/JSON.pb.h index a8125bf..ff65656 100644 --- a/src/uscxml/plugins/invoker/umundo/JSON.pb.h +++ b/src/uscxml/plugins/invoker/umundo/JSON.pb.h @@ -8,16 +8,6 @@ #include <google/protobuf/stubs/common.h> -#if GOOGLE_PROTOBUF_VERSION < 2005000 -#error This file was generated by a newer version of protoc which is -#error incompatible with your Protocol Buffer headers. Please update -#error your headers. -#endif -#if 2005000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION -#error This file was generated by an older version of protoc which is -#error incompatible with your Protocol Buffer headers. Please -#error regenerate this file with a newer version of protoc. -#endif #include <google/protobuf/generated_message_util.h> #include <google/protobuf/message.h> diff --git a/src/uscxml/plugins/invoker/umundo/UmundoInvoker.cpp b/src/uscxml/plugins/invoker/umundo/UmundoInvoker.cpp index dd9c37d..1861db7 100644 --- a/src/uscxml/plugins/invoker/umundo/UmundoInvoker.cpp +++ b/src/uscxml/plugins/invoker/umundo/UmundoInvoker.cpp @@ -177,9 +177,9 @@ void UmundoInvoker::invoke(const InvokeRequest& req) { umundo::MDNSDiscoveryOptions discOpts; _discovery = new umundo::Discovery(umundo::Discovery::MDNS, &discOpts); - + _discovery->add(*_node); - + // add type from .proto or .desc files std::list<std::string> type; Event::getParam(req.params, "type", type); @@ -194,7 +194,7 @@ void UmundoInvoker::invoke(const InvokeRequest& req) { } typeIter++; } - + // add directory with .proto or .desc files std::list<std::string> types; Event::getParam(req.params, "type", types); @@ -282,7 +282,7 @@ void UmundoInvoker::receive(void* object, umundo::Message* msg) { if (msg->size() > 0) { event.data.compound["protobuf"] = Data(msg->data(), msg->size(), "application/x-protobuf"); } - + returnEvent(event); } |