当前位置: 首页>>代码示例>>PHP>>正文


PHP CIMNotify::MarkNotifyRead方法代码示例

本文整理汇总了PHP中CIMNotify::MarkNotifyRead方法的典型用法代码示例。如果您正苦于以下问题:PHP CIMNotify::MarkNotifyRead方法的具体用法?PHP CIMNotify::MarkNotifyRead怎么用?PHP CIMNotify::MarkNotifyRead使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CIMNotify的用法示例。


在下文中一共展示了CIMNotify::MarkNotifyRead方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __SendMessage

 private function __SendMessage($senderId, $receiverId, $messageID, $type, $message, $domain = "")
 {
     if (!$this->isInitialized) {
         $this->Initialize();
     }
     $receiverId = intval($receiverId);
     if ($receiverId <= 0) {
         return false;
     }
     $messageID = intval($messageID);
     if ($messageID <= 0) {
         return false;
     }
     if (!in_array($type, array("P", "S"))) {
         return false;
     }
     if (strlen($message) <= 0) {
         return false;
     }
     if (!CXMPPUtility::CheckXmppStatusOnline()) {
         return false;
     }
     $senderJId = false;
     $receiverJId = false;
     $arUserID = array();
     $arUserID[] = $receiverId;
     $senderId = intval($senderId);
     if ($senderId <= 0) {
         if ($senderId != -5) {
             return false;
         }
         $senderJId = self::GetSystemJId($domain);
     } else {
         $arUserID[] = $senderId;
     }
     if (!($arJID = CXMPPUtility::GetJIdByUserId($arUserID, $domain))) {
         return false;
     }
     if ($senderId > 0) {
         $senderJId = $arJID[$senderId];
     }
     $receiverJId = $arJID[$receiverId];
     if (!$senderJId) {
         CXMPPUtility::Show("Error senderId=" . $senderId . ", receiverId=" . $receiverId . ", messageID=" . $messageID . " - Sender not found", 0);
         return false;
     }
     if (!$receiverJId) {
         CXMPPUtility::Show("Error senderId=" . $senderId . ", receiverId=" . $receiverId . ", messageID=" . $messageID . " - Reseiver not found", 0);
         return false;
     }
     $messageType = "chat";
     if ($type == "S") {
         $messageType = "normal";
     }
     $arMessage = CXMPPUtility::GetMessageArray($senderJId, $receiverJId, $messageType, $message, $domain);
     $result = false;
     if (CXMPPServer::IsServerStarted()) {
         $server = CXMPPServer::GetServer();
         $result = $server->Send($receiverJId, $arMessage, $domain);
     } else {
         $result = CXMPPUtility::SendToServer($arMessage, $domain);
     }
     if ($result === true) {
         if (IsModuleInstalled("im") && CModule::IncludeModule("im")) {
             if ($type == "S") {
                 $CIMNotify = new CIMNotify($receiverId);
                 $CIMNotify->MarkNotifyRead($messageID);
             } else {
                 $CIMMessage = new CIMMessage($receiverId);
                 $CIMMessage->SetReadMessage($senderId);
             }
         } else {
             CSocNetMessages::MarkMessageRead($receiverId, $messageID);
         }
     } else {
         CXMPPUtility::Show("Error senderId=" . $senderId . ", receiverId=" . $receiverId . ", messageID=" . $messageID . " - Message was not send", 0);
     }
     return $result;
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:79,代码来源:factory.php

示例2: CIMNotify

             $arUsers[$value['USER']['id']] = $value['USER'];
         }
         $arRecent[] = $value['MESSAGE'];
     }
     echo CUtil::PhpToJsObject(array('USER_ID' => $USER->GetId(), 'RECENT' => $arRecent, 'USERS' => $arUsers, 'CHAT' => $arChat, 'ERROR' => ''));
 } else {
     if ($_POST['IM_NOTIFY_VIEWED'] == 'Y') {
         $errorMessage = "";
         $CIMNotify = new CIMNotify();
         $CIMNotify->MarkNotifyRead($_POST['MAX_ID'], true);
         echo CUtil::PhpToJsObject(array('ERROR' => $errorMessage));
     } else {
         if ($_POST['IM_NOTIFY_VIEW'] == 'Y') {
             $errorMessage = "";
             $CIMNotify = new CIMNotify();
             $CIMNotify->MarkNotifyRead($_POST['ID']);
             echo CUtil::PhpToJsObject(array('ERROR' => $errorMessage));
         } else {
             if ($_POST['IM_NOTIFY_CONFIRM'] == 'Y') {
                 $errorMessage = "";
                 $CIMNotify = new CIMNotify();
                 $CIMNotify->Confirm($_POST['NOTIFY_ID'], $_POST['NOTIFY_VALUE']);
                 echo CUtil::PhpToJsObject(array('NOTIFY_ID' => intval($_POST['NOTIFY_ID']), 'NOTIFY_VALUE' => $_POST['NOTIFY_VALUE'], 'ERROR' => $errorMessage));
             } else {
                 if ($_POST['IM_NOTIFY_REMOVE'] == 'Y') {
                     $errorMessage = "";
                     $CIMNotify = new CIMNotify();
                     $CIMNotify->DeleteWithCheck($_POST['NOTIFY_ID']);
                     echo CUtil::PhpToJsObject(array('NOTIFY_ID' => intval($_POST['NOTIFY_ID']), 'ERROR' => $errorMessage));
                 } else {
                     if ($_POST['IM_NOTIFY_GROUP_REMOVE'] == 'Y') {
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:im.ajax.php


注:本文中的CIMNotify::MarkNotifyRead方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。