本文整理汇总了C++中CChatChannel::PrivateMessage方法的典型用法代码示例。如果您正苦于以下问题:C++ CChatChannel::PrivateMessage方法的具体用法?C++ CChatChannel::PrivateMessage怎么用?C++ CChatChannel::PrivateMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CChatChannel
的用法示例。
在下文中一共展示了CChatChannel::PrivateMessage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Action
//.........这里部分代码省略.........
{
TCHAR *pszPassword = NULL;
size_t iMsgLength = strlen(pszMsg);
for ( size_t i = 0; i < iMsgLength; i++ )
{
if ( pszMsg[i] == '{' ) // there's a password here
{
pszMsg[i] = 0;
pszPassword = pszMsg + i + 1;
size_t iPasswordLength = strlen(pszPassword);
for ( i = 0; i < iPasswordLength; i++ )
{
if ( pszPassword[i] == '}' )
{
pszPassword[i] = '\0';
break;
}
}
break;
}
}
if ( CreateChannel(pszMsg, pszPassword, pMe) )
JoinChannel(pszMsg, pszPassword, pMe);
break;
}
case CHATACT_RenameChannel: // client shortcut: /rename
{
if ( !pChannel )
goto NoConference;
pMe->RenameChannel(pszMsg);
break;
}
case CHATACT_PrivateMessage: // client shortcut: /msg
{
if ( !pChannel )
goto NoConference;
// Split the recipient from the message (look for a space)
TCHAR buffer[2048];
strcpy(buffer, pszMsg);
size_t bufferLength = strlen(buffer);
size_t i = 0;
for ( ; i < bufferLength; i++ )
{
if ( buffer[i] == ' ' )
{
buffer[i] = '\0';
break;
}
}
pChannel->PrivateMessage(pMe, buffer, buffer + i + 1, lang);
break;
}
case CHATACT_AddIgnore: // client shortcut: +ignore
{
pMe->AddIgnore(pszMsg);
break;
}
case CHATACT_RemoveIgnore: // client shortcut: -ignore
{
pMe->RemoveIgnore(pszMsg);
break;
}
case CHATACT_ToggleIgnore: // client shortcut: /ignore
{