mirror of
https://github.com/wbbaddons/Tims-Chat.git
synced 2024-12-22 21:40:08 +00:00
Fix some issues
This commit is contained in:
parent
c999af663f
commit
900cd5542d
@ -7,5 +7,9 @@ before_install:
|
|||||||
- phpenv rehash
|
- phpenv rehash
|
||||||
before_script:
|
before_script:
|
||||||
- git clone --branch=master --depth=1 --quiet git://github.com/WoltLab/WCF.git WCF
|
- git clone --branch=master --depth=1 --quiet git://github.com/WoltLab/WCF.git WCF
|
||||||
|
- rm WCF/CodeSniff/WCF/Sniffs/Namespaces/ClassMustBeImportedSniff.php
|
||||||
|
- rm WCF/CodeSniff/WCF/Sniffs/Namespaces/UseDeclarationSniff.php
|
||||||
|
- sed -i 's/<rule ref="WCF.Namespaces.ClassMustBeImported" />//' WCF/CodeSniff/WCF/ruleset.xml
|
||||||
|
- sed -i 's/<rule ref="WCF.Namespaces.UseDeclaration" />//' WCF/CodeSniff/WCF/ruleset.xml
|
||||||
script:
|
script:
|
||||||
- phpcs -p --extensions=php --standard="`pwd`/WCF/CodeSniff/WCF" file
|
- phpcs -p --extensions=php --standard="`pwd`/WCF/CodeSniff/WCF" file
|
||||||
|
@ -117,17 +117,7 @@ public function assignVariables() {
|
|||||||
* Reads chat-version. Used to avoid caching of JS-File when Tims Chat is updated.
|
* Reads chat-version. Used to avoid caching of JS-File when Tims Chat is updated.
|
||||||
*/
|
*/
|
||||||
public function readChatVersion() {
|
public function readChatVersion() {
|
||||||
CacheHandler::getInstance()->addResource(
|
return $this->chatVersion = \wcf\data\package\PackageCache::getInstance()->getPackage(\wcf\util\ChatUtil::getPackageID())->packageVersion;
|
||||||
'packages',
|
|
||||||
WCF_DIR.'cache/cache.packages.php',
|
|
||||||
'wcf\system\cache\builder\PackageCacheBuilder'
|
|
||||||
);
|
|
||||||
$packages = CacheHandler::getInstance()->get('packages');
|
|
||||||
foreach ($packages as $package) {
|
|
||||||
if ($package->package != \wcf\util\ChatUtil::PACKAGE_IDENTIFIER) continue;
|
|
||||||
$this->chatVersion = $package->packageVersion;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -22,7 +22,6 @@ public function getData(array $cacheResource) {
|
|||||||
|
|
||||||
if (count($groupIDs)) {
|
if (count($groupIDs)) {
|
||||||
$conditionBuilder = new \wcf\system\database\util\PreparedStatementConditionBuilder();
|
$conditionBuilder = new \wcf\system\database\util\PreparedStatementConditionBuilder();
|
||||||
$conditionBuilder->add('acl_option.packageID IN (?)', array(\wcf\system\package\PackageDependencyHandler::getInstance()->getDependencies()));
|
|
||||||
$conditionBuilder->add('acl_option.objectTypeID = ?', array(\wcf\system\acl\ACLHandler::getInstance()->getObjectTypeID('be.bastelstu.wcf.chat.room')));
|
$conditionBuilder->add('acl_option.objectTypeID = ?', array(\wcf\system\acl\ACLHandler::getInstance()->getObjectTypeID('be.bastelstu.wcf.chat.room')));
|
||||||
$conditionBuilder->add('option_to_group.optionID = acl_option.optionID');
|
$conditionBuilder->add('option_to_group.optionID = acl_option.optionID');
|
||||||
$conditionBuilder->add('option_to_group.groupID IN (?)', array($groupIDs));
|
$conditionBuilder->add('option_to_group.groupID IN (?)', array($groupIDs));
|
||||||
|
@ -53,7 +53,6 @@ public function __construct(\wcf\data\user\User $user = null) {
|
|||||||
$userPermissions = array();
|
$userPermissions = array();
|
||||||
|
|
||||||
$conditionBuilder = new \wcf\system\database\util\PreparedStatementConditionBuilder();
|
$conditionBuilder = new \wcf\system\database\util\PreparedStatementConditionBuilder();
|
||||||
$conditionBuilder->add('acl_option.packageID IN (?)', array(PackageDependencyHandler::getInstance()->getDependencies()));
|
|
||||||
$conditionBuilder->add('acl_option.objectTypeID = ?', array(ACLHandler::getInstance()->getObjectTypeID('be.bastelstu.wcf.chat.room')));
|
$conditionBuilder->add('acl_option.objectTypeID = ?', array(ACLHandler::getInstance()->getObjectTypeID('be.bastelstu.wcf.chat.room')));
|
||||||
$conditionBuilder->add('option_to_user.optionID = acl_option.optionID');
|
$conditionBuilder->add('option_to_user.optionID = acl_option.optionID');
|
||||||
$conditionBuilder->add('option_to_user.userID = ?', array($user->userID));
|
$conditionBuilder->add('option_to_user.userID = ?', array($user->userID));
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace wcf\util;
|
namespace wcf\util;
|
||||||
|
use \wcf\data\package\PackageCache;
|
||||||
use \wcf\system\user\storage\UserStorageHandler;
|
use \wcf\system\user\storage\UserStorageHandler;
|
||||||
use \wcf\system\package\PackageDependencyHandler;
|
|
||||||
use \wcf\system\WCF;
|
use \wcf\system\WCF;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -87,7 +87,7 @@ public static function getDiedUsers() {
|
|||||||
*/
|
*/
|
||||||
public static function getPackageID() {
|
public static function getPackageID() {
|
||||||
if (self::$packageID === null) {
|
if (self::$packageID === null) {
|
||||||
self::$packageID = PackageDependencyHandler::getInstance()->getPackageID(self::PACKAGE_IDENTIFIER);
|
self::$packageID = PackageCache::getInstance()->getPackageID(self::PACKAGE_IDENTIFIER);
|
||||||
}
|
}
|
||||||
|
|
||||||
return self::$packageID;
|
return self::$packageID;
|
||||||
|
@ -147,7 +147,7 @@
|
|||||||
'wcf.chat.notify.title': '{lang}wcf.chat.notify.title{/lang}'
|
'wcf.chat.notify.title': '{lang}wcf.chat.notify.title{/lang}'
|
||||||
});
|
});
|
||||||
WCF.Icon.addObject({
|
WCF.Icon.addObject({
|
||||||
'be.bastelstu.wcf.chat.chat': '{icon size='L'}chat{/icon}'
|
'be.bastelstu.wcf.chat.chat': '{icon}chat{/icon}'
|
||||||
});
|
});
|
||||||
{event name='shouldInit'}
|
{event name='shouldInit'}
|
||||||
// Boot the chat
|
// Boot the chat
|
||||||
|
Loading…
Reference in New Issue
Block a user