$hash_filename='chat_last_full_check_'.@substr(md5(serialize(array($_COOKIE,$_SERVER['REMOTE_ADDR']))),0,2).'.bin';// 1 in 1296 chance of conflict with another user - good enough!
if(
((file_exists(get_custom_file_base().'/data_custom/modules/chat/chat_last_full_check.bin'))&&(filemtime(get_custom_file_base().'/data_custom/modules/chat/chat_last_full_check.bin')>=time()-intval(floatval(CHAT_ACTIVITY_PRUNE)/2.0)))&&// If we've done a check within CHAT_ACTIVITY_PRUNE/2 seconds don't try again unless something is new (we do need to allow pruning to happen sometimes)
((file_exists(get_custom_file_base().'/data_custom/modules/chat/'.$hash_filename))&&(filemtime(get_custom_file_base().'/data_custom/modules/chat/'.$hash_filename)>=time()-intval(floatval(CHAT_ACTIVITY_PRUNE)/2.0)))&&// If we've done a check within CHAT_ACTIVITY_PRUNE/2 seconds don't try again unless something is new (we do need to allow pruning to happen sometimes)
(($message_id!=-1)&&(file_exists(get_custom_file_base().'/data_custom/modules/chat/chat_last_msg.bin'))&&(intval(/*cms_file_get_contents_safe not available yet*/file_get_contents(get_custom_file_base().'/data_custom/modules/chat/chat_last_msg.bin'))<=$message_id))&&
(($event_id!=-1)&&(file_exists(get_custom_file_base().'/data_custom/modules/chat/chat_last_event.bin'))&&(intval(/*cms_file_get_contents_safe not available yet*/file_get_contents(get_custom_file_base().'/data_custom/modules/chat/chat_last_event.bin'))<=$event_id))