aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Lib/Chatroom.php
diff options
context:
space:
mode:
authorKlaus Weidenbach <Klaus.Weidenbach@gmx.net>2017-09-05 00:23:42 +0200
committerKlaus Weidenbach <Klaus.Weidenbach@gmx.net>2017-11-03 23:04:27 +0100
commit1a737be2b408135177a9e94dcffd0f68c0aca90b (patch)
tree17e565688120ef94db2fa1e9635d0d55f2e43c58 /Zotlabs/Lib/Chatroom.php
parent0ce7358f0f00cb000562dc34be13459eb5779c18 (diff)
downloadvolse-hubzilla-1a737be2b408135177a9e94dcffd0f68c0aca90b.tar.gz
volse-hubzilla-1a737be2b408135177a9e94dcffd0f68c0aca90b.tar.bz2
volse-hubzilla-1a737be2b408135177a9e94dcffd0f68c0aca90b.zip
:bulb: Improving Doxygen documentation.
Fix some Doxygen parsing errors. Improve hooks documentation.
Diffstat (limited to 'Zotlabs/Lib/Chatroom.php')
-rw-r--r--Zotlabs/Lib/Chatroom.php40
1 files changed, 24 insertions, 16 deletions
diff --git a/Zotlabs/Lib/Chatroom.php b/Zotlabs/Lib/Chatroom.php
index e1a9a10b3..e762620ae 100644
--- a/Zotlabs/Lib/Chatroom.php
+++ b/Zotlabs/Lib/Chatroom.php
@@ -2,22 +2,18 @@
namespace Zotlabs\Lib;
/**
- * @brief Chat related functions.
+ * @brief A class with chatroom related static methods.
*/
-
-
-
class Chatroom {
/**
* @brief Creates a chatroom.
*
* @param array $channel
* @param array $arr
- * @return An associative array containing:
- * - success: A boolean
- * - message: (optional) A string
+ * @return array An associative array containing:
+ * * \e boolean \b success - A boolean success status
+ * * \e string \b message - (optional) A string
*/
-
static public function create($channel, $arr) {
$ret = array('success' => false);
@@ -150,8 +146,8 @@ class Chatroom {
}
if(intval($x[0]['cr_expire'])) {
- $r = q("delete from chat where created < %s - INTERVAL %s and chat_room = %d",
- db_utcnow(),
+ $r = q("delete from chat where created < %s - INTERVAL %s and chat_room = %d",
+ db_utcnow(),
db_quoteinterval( intval($x[0]['cr_expire']) . ' MINUTE' ),
intval($x[0]['cr_id'])
);
@@ -225,10 +221,16 @@ class Chatroom {
}
/**
- * create a chat message via API.
+ * @brief Create a chat message via API.
+ *
* It is the caller's responsibility to enter the room.
- */
-
+ *
+ * @param int $uid
+ * @param int $room_id
+ * @param string $xchan
+ * @param string $text
+ * @return array
+ */
static public function message($uid, $room_id, $xchan, $text) {
$ret = array('success' => false);
@@ -245,12 +247,18 @@ class Chatroom {
if(! $r)
return $ret;
- $arr = array(
+ $arr = [
'chat_room' => $room_id,
'chat_xchan' => $xchan,
'chat_text' => $text
- );
-
+ ];
+ /**
+ * @hooks chat_message
+ * Called to create a chat message.
+ * * \e int \b chat_room
+ * * \e string \b chat_xchan
+ * * \e string \b chat_text
+ */
call_hooks('chat_message', $arr);
$x = q("insert into chat ( chat_room, chat_xchan, created, chat_text )