aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-04-26 16:27:03 -0700
committerfriendica <info@friendica.com>2014-04-26 16:27:03 -0700
commite40d2262527df91fe0161d18f2304f7095481874 (patch)
tree5cd9b014604db4a5f577c7ce884c0d8594ed81c7 /mod
parentd44b7d11a85503ec8398ab7fa73fffc85a1b86df (diff)
downloadvolse-hubzilla-e40d2262527df91fe0161d18f2304f7095481874.tar.gz
volse-hubzilla-e40d2262527df91fe0161d18f2304f7095481874.tar.bz2
volse-hubzilla-e40d2262527df91fe0161d18f2304f7095481874.zip
basic chatterbot support - though these would still require additional functionality in the API to maintain presence as they'll get kicked out of the room if they don't ping it regularly.
Diffstat (limited to 'mod')
-rw-r--r--mod/chatsvc.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/mod/chatsvc.php b/mod/chatsvc.php
index 9cc8778f5..43aa3d3c0 100644
--- a/mod/chatsvc.php
+++ b/mod/chatsvc.php
@@ -41,13 +41,22 @@ function chatsvc_post(&$a) {
if(! $r)
json_return_and_die($ret);
+ $arr = array(
+ 'chat_room' => $a->data['chat']['room_id'],
+ 'chat_xchan' => get_observer_hash(),
+ 'chat_text' => $text
+ );
+
+ call_hooks('chat_post',$arr);
+
$x = q("insert into chat ( chat_room, chat_xchan, created, chat_text )
values( %d, '%s', '%s', '%s' )",
intval($a->data['chat']['room_id']),
dbesc(get_observer_hash()),
dbesc(datetime_convert()),
- dbesc($text)
+ dbesc($arr['chat_text'])
);
+
$ret['success'] = true;
json_return_and_die($ret);
}