mirror of
https://github.com/Mibew/java.git
synced 2025-01-23 01:50:34 +03:00
Add ability for plugins to send custom messages
This commit is contained in:
parent
00d668a74a
commit
3594485267
@ -5,6 +5,6 @@
|
|||||||
Copyright (c) 2005-2011 Mibew Messenger Community
|
Copyright (c) 2005-2011 Mibew Messenger Community
|
||||||
License: http://mibew.org/license.php
|
License: http://mibew.org/license.php
|
||||||
*/
|
*/
|
||||||
(function(b,d,f){b.Collections.Messages=d.Collection.extend({model:b.Models.Message,initialize:function(){this.periodicallyCalled=[];this.periodicallyCalled.push(b.Objects.server.callFunctionsPeriodically(f.bind(this.updateMessagesFunctionBuilder,this),f.bind(this.updateMessages,this)))},finalize:function(){for(var a=0;a<this.periodicallyCalled.length;a++)b.Objects.server.stopCallFunctionsPeriodically(this.periodicallyCalled[a])},updateMessages:function(a){a.lastId&&b.Objects.Models.thread.set({lastId:a.lastId});
|
(function(c,d,h){c.Collections.Messages=d.Collection.extend({model:c.Models.Message,initialize:function(){this.periodicallyCalled=[];this.periodicallyCalled.push(c.Objects.server.callFunctionsPeriodically(h.bind(this.updateMessagesFunctionBuilder,this),h.bind(this.updateMessages,this)))},finalize:function(){for(var a=0;a<this.periodicallyCalled.length;a++)c.Objects.server.stopCallFunctionsPeriodically(this.periodicallyCalled[a])},updateMessages:function(a){a.lastId&&c.Objects.Models.thread.set({lastId:a.lastId});
|
||||||
for(var c=[],e=0,d=a.messages.length;e<d;e++)c.push(new b.Models.Message(a.messages[e]));0<c.length&&this.add(c)},updateMessagesFunctionBuilder:function(){var a=b.Objects.Models.thread,c=b.Objects.Models.user;return[{"function":"updateMessages",arguments:{"return":{messages:"messages",lastId:"lastId"},references:{},threadId:a.get("id"),token:a.get("token"),lastId:a.get("lastId"),user:!c.get("isAgent")}}]},add:function(){var a=Array.prototype.slice.apply(arguments),a=d.Collection.prototype.add.apply(this,
|
for(var j=c.Models.Message.prototype.KIND_PLUGIN,f=[],b,e,g=0,d=a.messages.length;g<d;g++)b=a.messages[g],b.kind!=j?f.push(new c.Models.Message(b)):"object"!=typeof b.message||null===b.message||(e=b.message.plugin||!1,e="process:"+(!1!==e?e+":":"")+"plugin:message",b={messageData:b,model:!1},this.trigger(e,b),b.model&&f.push(b.model));0<f.length&&this.add(f)},updateMessagesFunctionBuilder:function(){var a=c.Objects.Models.thread,d=c.Objects.Models.user;return[{"function":"updateMessages",arguments:{"return":{messages:"messages",
|
||||||
a);this.trigger("multiple:add");return a}})})(Mibew,Backbone,_);
|
lastId:"lastId"},references:{},threadId:a.get("id"),token:a.get("token"),lastId:a.get("lastId"),user:!d.get("isAgent")}}]},add:function(){var a=Array.prototype.slice.apply(arguments),a=d.Collection.prototype.add.apply(this,a);this.trigger("multiple:add");return a}})})(Mibew,Backbone,_);
|
||||||
|
@ -141,9 +141,9 @@ groupId:a.get("groupId"),name:a.get("name"),info:a.get("info"),email:a.get("emai
|
|||||||
Copyright (c) 2005-2011 Mibew Messenger Community
|
Copyright (c) 2005-2011 Mibew Messenger Community
|
||||||
License: http://mibew.org/license.php
|
License: http://mibew.org/license.php
|
||||||
*/
|
*/
|
||||||
(function(b,d,f){b.Collections.Messages=d.Collection.extend({model:b.Models.Message,initialize:function(){this.periodicallyCalled=[];this.periodicallyCalled.push(b.Objects.server.callFunctionsPeriodically(f.bind(this.updateMessagesFunctionBuilder,this),f.bind(this.updateMessages,this)))},finalize:function(){for(var a=0;a<this.periodicallyCalled.length;a++)b.Objects.server.stopCallFunctionsPeriodically(this.periodicallyCalled[a])},updateMessages:function(a){a.lastId&&b.Objects.Models.thread.set({lastId:a.lastId});
|
(function(c,d,h){c.Collections.Messages=d.Collection.extend({model:c.Models.Message,initialize:function(){this.periodicallyCalled=[];this.periodicallyCalled.push(c.Objects.server.callFunctionsPeriodically(h.bind(this.updateMessagesFunctionBuilder,this),h.bind(this.updateMessages,this)))},finalize:function(){for(var a=0;a<this.periodicallyCalled.length;a++)c.Objects.server.stopCallFunctionsPeriodically(this.periodicallyCalled[a])},updateMessages:function(a){a.lastId&&c.Objects.Models.thread.set({lastId:a.lastId});
|
||||||
for(var c=[],e=0,d=a.messages.length;e<d;e++)c.push(new b.Models.Message(a.messages[e]));0<c.length&&this.add(c)},updateMessagesFunctionBuilder:function(){var a=b.Objects.Models.thread,c=b.Objects.Models.user;return[{"function":"updateMessages",arguments:{"return":{messages:"messages",lastId:"lastId"},references:{},threadId:a.get("id"),token:a.get("token"),lastId:a.get("lastId"),user:!c.get("isAgent")}}]},add:function(){var a=Array.prototype.slice.apply(arguments),a=d.Collection.prototype.add.apply(this,
|
for(var j=c.Models.Message.prototype.KIND_PLUGIN,f=[],b,e,g=0,d=a.messages.length;g<d;g++)b=a.messages[g],b.kind!=j?f.push(new c.Models.Message(b)):"object"!=typeof b.message||null===b.message||(e=b.message.plugin||!1,e="process:"+(!1!==e?e+":":"")+"plugin:message",b={messageData:b,model:!1},this.trigger(e,b),b.model&&f.push(b.model));0<f.length&&this.add(f)},updateMessagesFunctionBuilder:function(){var a=c.Objects.Models.thread,d=c.Objects.Models.user;return[{"function":"updateMessages",arguments:{"return":{messages:"messages",
|
||||||
a);this.trigger("multiple:add");return a}})})(Mibew,Backbone,_);
|
lastId:"lastId"},references:{},threadId:a.get("id"),token:a.get("token"),lastId:a.get("lastId"),user:!d.get("isAgent")}}]},add:function(){var a=Array.prototype.slice.apply(arguments),a=d.Collection.prototype.add.apply(this,a);this.trigger("multiple:add");return a}})})(Mibew,Backbone,_);
|
||||||
/*
|
/*
|
||||||
This file is part of Mibew Messenger project.
|
This file is part of Mibew Messenger project.
|
||||||
http://mibew.org
|
http://mibew.org
|
||||||
|
@ -6,4 +6,4 @@
|
|||||||
License: http://mibew.org/license.php
|
License: http://mibew.org/license.php
|
||||||
*/
|
*/
|
||||||
(function(c,d,e){var f={"<":"<",">":">","&":"&",'"':""","'":"'","`":"`"},g=/[&<>'"`]/g;c.Views.Message=d.Marionette.ItemView.extend({template:e.templates.message,className:"message",modelEvents:{change:"render"},serializeData:function(){var a=this.model.toJSON(),b=this.model.get("kind");a.allowFormatting=b!=this.model.KIND_USER&&b!=this.model.KIND_AGENT;a.kindName=this.kindToString(b);a.message=this.escapeString(a.message);return a},kindToString:function(a){return a==this.model.KIND_USER?
|
(function(c,d,e){var f={"<":"<",">":">","&":"&",'"':""","'":"'","`":"`"},g=/[&<>'"`]/g;c.Views.Message=d.Marionette.ItemView.extend({template:e.templates.message,className:"message",modelEvents:{change:"render"},serializeData:function(){var a=this.model.toJSON(),b=this.model.get("kind");a.allowFormatting=b!=this.model.KIND_USER&&b!=this.model.KIND_AGENT;a.kindName=this.kindToString(b);a.message=this.escapeString(a.message);return a},kindToString:function(a){return a==this.model.KIND_USER?
|
||||||
"user":a==this.model.KIND_AGENT?"agent":a==this.model.KIND_FOR_AGENT?"hidden":a==this.model.KIND_INFO?"inf":a==this.model.KIND_CONN?"conn":a==this.model.KIND_EVENTS?"event":""},escapeString:function(a){return a.replace(g,function(a){return f[a]||"&"})}})})(Mibew,Backbone,Handlebars);
|
"user":a==this.model.KIND_AGENT?"agent":a==this.model.KIND_FOR_AGENT?"hidden":a==this.model.KIND_INFO?"inf":a==this.model.KIND_CONN?"conn":a==this.model.KIND_EVENTS?"event":a==this.model.KIND_PLUGIN?"plugin":""},escapeString:function(a){return a.replace(g,function(a){return f[a]||"&"})}})})(Mibew,Backbone,Handlebars);
|
||||||
|
@ -5,4 +5,4 @@
|
|||||||
Copyright (c) 2005-2011 Mibew Messenger Community
|
Copyright (c) 2005-2011 Mibew Messenger Community
|
||||||
License: http://mibew.org/license.php
|
License: http://mibew.org/license.php
|
||||||
*/
|
*/
|
||||||
(function(a){a.Models.Message=a.Models.Base.extend({defaults:{kind:null,created:0,name:"",message:""},KIND_USER:1,KIND_AGENT:2,KIND_FOR_AGENT:3,KIND_INFO:4,KIND_CONN:5,KIND_EVENTS:6})})(Mibew);
|
(function(a){a.Models.Message=a.Models.Base.extend({defaults:{kind:null,created:0,name:"",message:""},KIND_USER:1,KIND_AGENT:2,KIND_FOR_AGENT:3,KIND_INFO:4,KIND_CONN:5,KIND_EVENTS:6,KIND_PLUGIN:7})})(Mibew);
|
||||||
|
@ -73,7 +73,7 @@ b.Utils.playSound=function(a){c("body").append('<audio autoplay style="display:
|
|||||||
Copyright (c) 2005-2011 Mibew Messenger Community
|
Copyright (c) 2005-2011 Mibew Messenger Community
|
||||||
License: http://mibew.org/license.php
|
License: http://mibew.org/license.php
|
||||||
*/
|
*/
|
||||||
(function(a){a.Models.Message=a.Models.Base.extend({defaults:{kind:null,created:0,name:"",message:""},KIND_USER:1,KIND_AGENT:2,KIND_FOR_AGENT:3,KIND_INFO:4,KIND_CONN:5,KIND_EVENTS:6})})(Mibew);
|
(function(a){a.Models.Message=a.Models.Base.extend({defaults:{kind:null,created:0,name:"",message:""},KIND_USER:1,KIND_AGENT:2,KIND_FOR_AGENT:3,KIND_INFO:4,KIND_CONN:5,KIND_EVENTS:6,KIND_PLUGIN:7})})(Mibew);
|
||||||
/*
|
/*
|
||||||
This file is part of Mibew Messenger project.
|
This file is part of Mibew Messenger project.
|
||||||
http://mibew.org
|
http://mibew.org
|
||||||
@ -117,7 +117,7 @@ this.$el.removeClass("active"+(a?"-"+a:""))},getDashedControlType:function(){"un
|
|||||||
License: http://mibew.org/license.php
|
License: http://mibew.org/license.php
|
||||||
*/
|
*/
|
||||||
(function(c,d,e){var f={"<":"<",">":">","&":"&",'"':""","'":"'","`":"`"},g=/[&<>'"`]/g;c.Views.Message=d.Marionette.ItemView.extend({template:e.templates.message,className:"message",modelEvents:{change:"render"},serializeData:function(){var a=this.model.toJSON(),b=this.model.get("kind");a.allowFormatting=b!=this.model.KIND_USER&&b!=this.model.KIND_AGENT;a.kindName=this.kindToString(b);a.message=this.escapeString(a.message);return a},kindToString:function(a){return a==this.model.KIND_USER?
|
(function(c,d,e){var f={"<":"<",">":">","&":"&",'"':""","'":"'","`":"`"},g=/[&<>'"`]/g;c.Views.Message=d.Marionette.ItemView.extend({template:e.templates.message,className:"message",modelEvents:{change:"render"},serializeData:function(){var a=this.model.toJSON(),b=this.model.get("kind");a.allowFormatting=b!=this.model.KIND_USER&&b!=this.model.KIND_AGENT;a.kindName=this.kindToString(b);a.message=this.escapeString(a.message);return a},kindToString:function(a){return a==this.model.KIND_USER?
|
||||||
"user":a==this.model.KIND_AGENT?"agent":a==this.model.KIND_FOR_AGENT?"hidden":a==this.model.KIND_INFO?"inf":a==this.model.KIND_CONN?"conn":a==this.model.KIND_EVENTS?"event":""},escapeString:function(a){return a.replace(g,function(a){return f[a]||"&"})}})})(Mibew,Backbone,Handlebars);
|
"user":a==this.model.KIND_AGENT?"agent":a==this.model.KIND_FOR_AGENT?"hidden":a==this.model.KIND_INFO?"inf":a==this.model.KIND_CONN?"conn":a==this.model.KIND_EVENTS?"event":a==this.model.KIND_PLUGIN?"plugin":""},escapeString:function(a){return a.replace(g,function(a){return f[a]||"&"})}})})(Mibew,Backbone,Handlebars);
|
||||||
/*
|
/*
|
||||||
This file is part of Mibew Messenger project.
|
This file is part of Mibew Messenger project.
|
||||||
http://mibew.org
|
http://mibew.org
|
||||||
|
@ -63,13 +63,69 @@
|
|||||||
Mibew.Objects.Models.thread.set({lastId: args.lastId});
|
Mibew.Objects.Models.thread.set({lastId: args.lastId});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Use shortcut for KIND_PLUGIN
|
||||||
|
var kindPlugin = Mibew.Models.Message.prototype.KIND_PLUGIN;
|
||||||
|
|
||||||
// Get all new messages
|
// Get all new messages
|
||||||
var newMessages = [];
|
var newMessages = [];
|
||||||
|
var messageData, pluginName, eventName, eventArgs;
|
||||||
for(var i = 0, length = args.messages.length; i < length; i++) {
|
for(var i = 0, length = args.messages.length; i < length; i++) {
|
||||||
// Store message
|
messageData = args.messages[i];
|
||||||
|
if (messageData.kind != kindPlugin) {
|
||||||
|
// Message have one of the core kinds. Just store it.
|
||||||
newMessages.push(
|
newMessages.push(
|
||||||
new Mibew.Models.Message(args.messages[i])
|
new Mibew.Models.Message(messageData)
|
||||||
);
|
);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Message have KIND_PLUGIN kind and need to be processed
|
||||||
|
// by plugins to know how to display it.
|
||||||
|
//
|
||||||
|
// Message treat as data object with following fields:
|
||||||
|
// - 'plugin': string, name of the plugin which sent the
|
||||||
|
// message;
|
||||||
|
// - 'data': object, some data sent by the plugin.
|
||||||
|
|
||||||
|
// Check if message is an real Object
|
||||||
|
if ((typeof messageData.message != 'object')
|
||||||
|
|| (messageData.message === null)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Prepare event name.
|
||||||
|
//
|
||||||
|
// If plugin name was specified it will be
|
||||||
|
// 'process:<plugin_name>:plugin:message' and
|
||||||
|
// 'process:plugin:message' otherwise.
|
||||||
|
pluginName = messageData.message.plugin || false;
|
||||||
|
eventName = 'process:'
|
||||||
|
+ ((pluginName !== false) ? pluginName + ':' : '')
|
||||||
|
+ 'plugin:message';
|
||||||
|
|
||||||
|
// Prepare event arguments.
|
||||||
|
//
|
||||||
|
// It is an object with following fields:
|
||||||
|
// - 'messageData': object which contains message data
|
||||||
|
// passed from server.
|
||||||
|
// - 'model': message model initialized by the plugin or
|
||||||
|
// boolean false if message should not be displayed. By
|
||||||
|
// default it field equals to boolean false.
|
||||||
|
eventArgs = {
|
||||||
|
'messageData': messageData,
|
||||||
|
'model': false
|
||||||
|
}
|
||||||
|
|
||||||
|
// Trigger event. See description of eventName and eventArgs
|
||||||
|
// above.
|
||||||
|
this.trigger(eventName, eventArgs);
|
||||||
|
|
||||||
|
if (eventArgs.model) {
|
||||||
|
// Store custom plugin message in the collection
|
||||||
|
newMessages.push(
|
||||||
|
eventArgs.model
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add new messages to the message collection if there are any
|
// Add new messages to the message collection if there are any
|
||||||
|
@ -97,6 +97,9 @@
|
|||||||
if (kind == this.model.KIND_EVENTS) {
|
if (kind == this.model.KIND_EVENTS) {
|
||||||
return "event";
|
return "event";
|
||||||
}
|
}
|
||||||
|
if (kind == this.model.KIND_PLUGIN) {
|
||||||
|
return "plugin";
|
||||||
|
}
|
||||||
return "";
|
return "";
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -61,7 +61,10 @@
|
|||||||
KIND_CONN: 5,
|
KIND_CONN: 5,
|
||||||
|
|
||||||
/** System message about some events (like rename). */
|
/** System message about some events (like rename). */
|
||||||
KIND_EVENTS: 6
|
KIND_EVENTS: 6,
|
||||||
|
|
||||||
|
/** Message sent by a plugin */
|
||||||
|
KIND_PLUGIN: 7
|
||||||
|
|
||||||
/** End of message kind constants */
|
/** End of message kind constants */
|
||||||
}
|
}
|
||||||
|
@ -86,6 +86,10 @@ Class Thread {
|
|||||||
* System message about some events (like rename).
|
* System message about some events (like rename).
|
||||||
*/
|
*/
|
||||||
const KIND_EVENTS = 6;
|
const KIND_EVENTS = 6;
|
||||||
|
/**
|
||||||
|
* Message sent by a plugin.
|
||||||
|
*/
|
||||||
|
const KIND_PLUGIN = 7;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Messaging window connection timeout.
|
* Messaging window connection timeout.
|
||||||
@ -658,7 +662,8 @@ Class Thread {
|
|||||||
* - 'kind': int, message kind, see Thread::KIND_* for details;
|
* - 'kind': int, message kind, see Thread::KIND_* for details;
|
||||||
* - 'created': int, unix timestamp when message was created;
|
* - 'created': int, unix timestamp when message was created;
|
||||||
* - 'name': string, name of sender;
|
* - 'name': string, name of sender;
|
||||||
* - 'message': string, message text.
|
* - 'message': associative array with message data if kind equals to
|
||||||
|
* Thread::KIND_PLUGIN and message text string otherwise.
|
||||||
* @see Thread::postMessage()
|
* @see Thread::postMessage()
|
||||||
*/
|
*/
|
||||||
public function getMessages($is_user, &$last_id) {
|
public function getMessages($is_user, &$last_id) {
|
||||||
@ -668,7 +673,8 @@ Class Thread {
|
|||||||
|
|
||||||
// Load messages
|
// Load messages
|
||||||
$messages = $db->query(
|
$messages = $db->query(
|
||||||
"select messageid as id, ikind as kind, dtmcreated as created, tname as name, tmessage as message " .
|
"select messageid as id, ikind as kind, dtmcreated as created, " .
|
||||||
|
" tname as name, tmessage as message " .
|
||||||
"from {chatmessage} " .
|
"from {chatmessage} " .
|
||||||
"where threadid = :threadid and messageid > :lastid " .
|
"where threadid = :threadid and messageid > :lastid " .
|
||||||
($is_user ? "and ikind <> " . self::KIND_FOR_AGENT : "") .
|
($is_user ? "and ikind <> " . self::KIND_FOR_AGENT : "") .
|
||||||
@ -681,9 +687,28 @@ Class Thread {
|
|||||||
);
|
);
|
||||||
|
|
||||||
foreach ($messages as $key => $msg) {
|
foreach ($messages as $key => $msg) {
|
||||||
// Change message fields encoding
|
// Change sender name encoding
|
||||||
$messages[$key]['name'] = myiconv($webim_encoding, "utf-8", $msg['name']);
|
$messages[$key]['name'] = myiconv(
|
||||||
$messages[$key]['message'] = myiconv($webim_encoding, "utf-8", $msg['message']);
|
$webim_encoding,
|
||||||
|
"utf-8",
|
||||||
|
$msg['name']
|
||||||
|
);
|
||||||
|
|
||||||
|
// Process message body
|
||||||
|
if ($messages[$key]['kind'] == self::KIND_PLUGIN) {
|
||||||
|
// Treat plugin message body as an associative array
|
||||||
|
$messages[$key]['message'] = unserialize(
|
||||||
|
$messages[$key]['message']
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
// Change message body encoding for core messages kinds
|
||||||
|
$messages[$key]['message'] = myiconv(
|
||||||
|
$webim_encoding,
|
||||||
|
"utf-8",
|
||||||
|
$msg['message']
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// Get last message ID
|
// Get last message ID
|
||||||
if ($msg['id'] > $last_id) {
|
if ($msg['id'] > $last_id) {
|
||||||
$last_id = $msg['id'];
|
$last_id = $msg['id'];
|
||||||
@ -696,11 +721,24 @@ Class Thread {
|
|||||||
/**
|
/**
|
||||||
* Send the messsage
|
* Send the messsage
|
||||||
*
|
*
|
||||||
|
* Message body, passed as $message argument can be either string or
|
||||||
|
* associative array. It depends on $kind argument value.
|
||||||
|
* If $kind equals to Thread:KIND_PLUGIN $message must be an associative
|
||||||
|
* array with following keys:
|
||||||
|
* - 'plugin': string, name of the plugin which send the message;
|
||||||
|
* - 'data': associative array, arbitrary message data.
|
||||||
|
* Message body in this case will automatically serialized and unserialized
|
||||||
|
* then it needed.
|
||||||
|
*
|
||||||
|
* On the other hand, if $kind argument NOT equals to Thread::KIND_PLUGIN
|
||||||
|
* $message must be a string, representing message text.
|
||||||
|
*
|
||||||
* @param int $kind Message kind. One of the Thread::KIND_*
|
* @param int $kind Message kind. One of the Thread::KIND_*
|
||||||
* @param string $message Message body
|
* @param string|array $message Message body
|
||||||
* @param string|null $from Sender name
|
* @param string|null $from Sender name
|
||||||
* @param int|null $opid operator id. Use NULL for system messages
|
* @param int|null $opid operator id. Use NULL for system messages
|
||||||
* @param int|null $time unix timestamp of the send time. Use NULL for current time.
|
* @param int|null $time unix timestamp of the send time. Use NULL for
|
||||||
|
* current time.
|
||||||
* @return int Message ID
|
* @return int Message ID
|
||||||
*
|
*
|
||||||
* @see Thread::KIND_USER
|
* @see Thread::KIND_USER
|
||||||
@ -709,6 +747,7 @@ Class Thread {
|
|||||||
* @see Thread::KIND_INFO
|
* @see Thread::KIND_INFO
|
||||||
* @see Thread::KIND_CONN
|
* @see Thread::KIND_CONN
|
||||||
* @see Thread::KIND_EVENTS
|
* @see Thread::KIND_EVENTS
|
||||||
|
* @see Thread::KIND_PLUGIN
|
||||||
* @see Thread::getMessages()
|
* @see Thread::getMessages()
|
||||||
*/
|
*/
|
||||||
public function postMessage($kind, $message, $from = null, $opid = null, $time = null) {
|
public function postMessage($kind, $message, $from = null, $opid = null, $time = null) {
|
||||||
@ -718,6 +757,12 @@ Class Thread {
|
|||||||
"(threadid,ikind,tmessage,tname,agentId,dtmcreated) " .
|
"(threadid,ikind,tmessage,tname,agentId,dtmcreated) " .
|
||||||
"VALUES (:threadid,:kind,:message,:name,:agentid,:created)";
|
"VALUES (:threadid,:kind,:message,:name,:agentid,:created)";
|
||||||
|
|
||||||
|
// Serialize message body for messages with kind equals to
|
||||||
|
// Thread::KIND_PLUGIN
|
||||||
|
if ($kind == self::KIND_PLUGIN) {
|
||||||
|
$message = serialize($message);
|
||||||
|
}
|
||||||
|
|
||||||
$values = array(
|
$values = array(
|
||||||
':threadid' => $this->id,
|
':threadid' => $this->id,
|
||||||
':kind' => $kind,
|
':kind' => $kind,
|
||||||
|
Loading…
Reference in New Issue
Block a user