webmain/task/api/tonghuaAction.php

(开头部分) 5KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<?php 
class tonghuaClassAction extends apiAction
{
	/**
	*	通话初始化
	*/
	public function thinitAction()
	{
		if(!getconfig('video_bool'))return returnerror('系统未开启音视频');
		$id 		= (int)$this->get('id');
		$type 		= (int)$this->get('type');
		$rtctype 	= 1; //0,1腾讯
		if($id==$this->adminid)return returnerror('不能和自己通话');
		$nowtime 	= strtotime($this->now);
		
		$allfields	= $this->db->getallfields('[Q]im_tonghua');
		if(!in_array('toid', $allfields)){
			$this->db->addFields('[Q]im_tonghua','toid','int(11)','0','对于人id可能是组');
		}
		
		
		//判断是不是在通话中
		$thrs 		= m('im_tonghua')->getone('(`faid`='.$id.' or `toid`='.$id.') and (`state` in(0,4) or (`state`=1 and enddt is null))', '*', 'id desc');
		if($thrs){
			$time  	= time() - strtotime($thrs['adddt']);
			$state	= (int)$thrs['state'];
			$stime  = 60;
			if($state == 1)$stime = 30* 60;
			if($time < $stime)return returnerror('对方忙线');//60秒内
		}
		
		//判断用户有没有在线
		$gbarr = m('reim')->pushserver('getonline', array(
			'onlineid' => $id
		));
		if(!$gbarr)return returnerror('没有服务端');

		
		if(!$gbarr['success'])return $gbarr;
		$ondats = json_decode(arrvalue($gbarr,'data'), true);
		$online = false;
		if($ondats){
			if($ondats['pc']==$id)$online = true;
			if($ondats['app']==$id)$online = true;
		}
		
		if(!$online){
			$trows 	= m('login')->getall('`uid`='.$id.' and `online`=1 and `ispush`=1');
			if(!$trows)return returnerror('对方不在线,无法通话');
			
			$appfw  = $this->option->getval('reimappwxsystem');
			if($appfw != '1')return returnerror('服务端没开启APP可用');
			
			$isbo 	= true;
			foreach($trows as $k=>$rs){
				$web = $rs['web'];
				if(!contain($web, 'iphone'))$isbo = false;
			}
			//if($isbo)return returnerror('对方使用iphone,暂不支持通话');
		}
后面还有 142 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。