aboutsummaryrefslogtreecommitdiffstats
path: root/library/ajaxchat/chat
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-01-27 15:55:08 -0800
committerfriendica <info@friendica.com>2014-01-27 15:55:08 -0800
commitd9794b981d56c0e0f6e23d33a421e64378fd78a6 (patch)
tree763950bb677da122ee43bf22b1a50bdbc6c5f68a /library/ajaxchat/chat
parent24bac92acdf04a49eb65fc947f25fafb2b2044fa (diff)
downloadvolse-hubzilla-d9794b981d56c0e0f6e23d33a421e64378fd78a6.tar.gz
volse-hubzilla-d9794b981d56c0e0f6e23d33a421e64378fd78a6.tar.bz2
volse-hubzilla-d9794b981d56c0e0f6e23d33a421e64378fd78a6.zip
In order to provide ajax chat accessible by remote visitors (xchans), we need to remove any core assumptions that userID is an int (which is a common centralised site assumption). Additionally we won't be able to provide guest logins, as this also assumes integer ID's; so that ability needs to be disabled by configuration.
Diffstat (limited to 'library/ajaxchat/chat')
-rw-r--r--library/ajaxchat/chat/lib/class/AJAXChat.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/library/ajaxchat/chat/lib/class/AJAXChat.php b/library/ajaxchat/chat/lib/class/AJAXChat.php
index 2cf7aa11f..215b2c4e1 100644
--- a/library/ajaxchat/chat/lib/class/AJAXChat.php
+++ b/library/ajaxchat/chat/lib/class/AJAXChat.php
@@ -60,12 +60,12 @@ class AJAXChat {
function initRequestVars() {
$this->_requestVars = array();
$this->_requestVars['ajax'] = isset($_REQUEST['ajax']) ? true : false;
- $this->_requestVars['userID'] = isset($_REQUEST['userID']) ? (int)$_REQUEST['userID'] : null;
+ $this->_requestVars['userID'] = isset($_REQUEST['userID']) ? $_REQUEST['userID'] : null;
$this->_requestVars['userName'] = isset($_REQUEST['userName']) ? $_REQUEST['userName'] : null;
- $this->_requestVars['channelID'] = isset($_REQUEST['channelID']) ? (int)$_REQUEST['channelID'] : null;
+ $this->_requestVars['channelID'] = isset($_REQUEST['channelID']) ? $_REQUEST['channelID'] : null;
$this->_requestVars['channelName'] = isset($_REQUEST['channelName']) ? $_REQUEST['channelName'] : null;
$this->_requestVars['text'] = isset($_POST['text']) ? $_POST['text'] : null;
- $this->_requestVars['lastID'] = isset($_REQUEST['lastID']) ? (int)$_REQUEST['lastID'] : 0;
+ $this->_requestVars['lastID'] = isset($_REQUEST['lastID']) ? $_REQUEST['lastID'] : '';
$this->_requestVars['login'] = isset($_REQUEST['login']) ? true : false;
$this->_requestVars['logout'] = isset($_REQUEST['logout']) ? true : false;
$this->_requestVars['password'] = isset($_REQUEST['password']) ? $_REQUEST['password'] : null;
@@ -3052,14 +3052,14 @@ class AJAXChat {
if($userID === null) {
$userID = $this->getUserID();
}
- return $userID + $this->getConfig('privateChannelDiff');
+ return $userID . '.' . $this->getConfig('privateChannelDiff');
}
function getPrivateMessageID($userID=null) {
if($userID === null) {
$userID = $this->getUserID();
}
- return $userID + $this->getConfig('privateMessageDiff');
+ return $userID . '.' . $this->getConfig('privateMessageDiff');
}
function isAllowedToSendPrivateMessage() {