chat expiration (default 2 hours) - but can be set on a per-chatroom basis

This commit is contained in:
friendica
2014-01-30 20:10:47 -08:00
parent 49f07bd90f
commit a1d40431f2
4 changed files with 22 additions and 5 deletions

View File

@@ -247,6 +247,7 @@ CREATE TABLE IF NOT EXISTS `chatroom` (
`cr_name` char(255) NOT NULL DEFAULT '',
`cr_created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`cr_edited` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`cr_expire` int(10) unsigned NOT NULL DEFAULT '0',
`allow_cid` mediumtext NOT NULL,
`allow_gid` mediumtext NOT NULL,
`deny_cid` mediumtext NOT NULL,
@@ -256,7 +257,8 @@ CREATE TABLE IF NOT EXISTS `chatroom` (
KEY `cr_uid` (`cr_uid`),
KEY `cr_name` (`cr_name`),
KEY `cr_created` (`cr_created`),
KEY `cr_edited` (`cr_edited`)
KEY `cr_edited` (`cr_edited`),
KEY `cr_expire` (`cr_expire`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `clients` (

View File

@@ -1,6 +1,6 @@
<?php
define( 'UPDATE_VERSION' , 1094 );
define( 'UPDATE_VERSION' , 1095 );
/**
*
@@ -1060,3 +1060,12 @@ function update_r1093() {
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
function update_r1094() {
$r = q("ALTER TABLE `chatroom` ADD `cr_expire` INT UNSIGNED NOT NULL DEFAULT '0' AFTER `cr_edited` ,
ADD INDEX ( `cr_expire` )");
if($r)
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}