From 4aa44861b41b06361a9e4b465143edddeb31fd13 Mon Sep 17 00:00:00 2001 From: Dmitriy Simushev Date: Thu, 20 Sep 2012 15:02:20 +0000 Subject: [PATCH] Add parameters to the Window-to-Core interaction Add 'threadId' and 'token' obligatory parameters to the Window-to-Core interaction type --- src/messenger/webim/js/164/mibewapi.js | 2 +- src/messenger/webim/js/source/mibewapi.js | 2 ++ .../webim/libs/classes/mibew_api_window_interaction.php | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/messenger/webim/js/164/mibewapi.js b/src/messenger/webim/js/164/mibewapi.js index 4161639d..b11b0ba1 100644 --- a/src/messenger/webim/js/164/mibewapi.js +++ b/src/messenger/webim/js/164/mibewapi.js @@ -15,7 +15,7 @@ MibewAPI.prototype.buildResult=function(a,b){var c=this.interaction.getObligator MibewAPI.prototype.decodePackage=function(a){a=JSON.parse(decodeURIComponent(a.replace(/\+/gi," ")));this.checkPackage(a);return a};function MibewAPIInteraction(){this.obligatoryArguments={};this.reservedFunctionNames=[]} MibewAPIInteraction.prototype.getObligatoryArguments=function(a){var b=[];if("object"==typeof this.obligatoryArguments["*"])for(var c in this.obligatoryArguments["*"])this.obligatoryArguments["*"].hasOwnProperty(c)&&b.push(c);if("object"==typeof this.obligatoryArguments[a])for(c in this.obligatoryArguments[a])this.obligatoryArguments[a].hasOwnProperty(c)&&b.push(c);return b}; MibewAPIInteraction.prototype.getObligatoryArgumentsDefaults=function(a){var b={};if("object"==typeof this.obligatoryArguments["*"])for(var c in this.obligatoryArguments["*"])this.obligatoryArguments["*"].hasOwnProperty(c)&&(b[c]=this.obligatoryArguments["*"][c]);if("object"==typeof this.obligatoryArguments[a])for(c in this.obligatoryArguments[a])this.obligatoryArguments[a].hasOwnProperty(c)&&(b[c]=this.obligatoryArguments[a][c]);return b}; -function MibewAPICoreInteraction(){this.obligatoryArguments={"*":{"return":{},references:{}},result:{errorCode:0}};this.reservedFunctionNames=["result"]}MibewAPICoreInteraction.prototype=new MibewAPIInteraction;function MibewAPIExecutionContext(){this.returnValues={};this.functionsResults=[]} +function MibewAPICoreInteraction(){this.obligatoryArguments={"*":{threadId:null,token:null,"return":{},references:{}},result:{errorCode:0}};this.reservedFunctionNames=["result"]}MibewAPICoreInteraction.prototype=new MibewAPIInteraction;function MibewAPIExecutionContext(){this.returnValues={};this.functionsResults=[]} MibewAPIExecutionContext.prototype.getArgumentsList=function(a){var b=a.arguments,c=a.arguments.references,d,f,e;for(e in c)if(c.hasOwnProperty(e)){f=c[e];if("undefined"==typeof this.functionsResults[f-1])throw Error("Wrong reference in '"+a["function"]+"' function. Function #"+f+" does not call yet.");if("undefined"==typeof b[e]||""==b[e])throw Error("Wrong reference in '"+a["function"]+"' function. Empty '"+e+"' argument.");d=b[e];if("undefined"==typeof this.functionsResults[f-1][d])throw Error("Wrong reference in '"+ a["function"]+"' function. There is no '"+d+"' argument in #"+f+" function results");b[e]=this.functionsResults[f-1][d]}return b};MibewAPIExecutionContext.prototype.getResults=function(){return this.returnValues}; MibewAPIExecutionContext.prototype.storeFunctionResults=function(a,b){var c,d;for(d in a.arguments["return"])if(a.arguments["return"].hasOwnProperty(d)){c=a.arguments["return"][d];if("undefined"==typeof b[d])throw Error("Variable with name '"+d+"' is undefined in the results of the '"+a["function"]+"' function");this.returnValues[c]=b[d]}this.functionsResults.push(b)}; \ No newline at end of file diff --git a/src/messenger/webim/js/source/mibewapi.js b/src/messenger/webim/js/source/mibewapi.js index bc0e8a3b..b12c82fa 100644 --- a/src/messenger/webim/js/source/mibewapi.js +++ b/src/messenger/webim/js/source/mibewapi.js @@ -386,6 +386,8 @@ MibewAPIInteraction.prototype.getObligatoryArgumentsDefaults = function(function function MibewAPICoreInteraction() { this.obligatoryArguments = { '*': { + 'threadId': null, + 'token': null, 'return': {}, 'references': {} }, diff --git a/src/messenger/webim/libs/classes/mibew_api_window_interaction.php b/src/messenger/webim/libs/classes/mibew_api_window_interaction.php index 50ad1ab9..4afd1a27 100644 --- a/src/messenger/webim/libs/classes/mibew_api_window_interaction.php +++ b/src/messenger/webim/libs/classes/mibew_api_window_interaction.php @@ -26,6 +26,8 @@ class MibewAPIWindowInteraction extends MibewAPIInteraction { */ protected $obligatoryArguments = array( '*' => array( + 'threadId' => null, + 'token' => null, 'references' => array(), 'return' => array() ),