本文整理汇总了C++中AccountManager::SetReplicantMessenger方法的典型用法代码示例。如果您正苦于以下问题:C++ AccountManager::SetReplicantMessenger方法的具体用法?C++ AccountManager::SetReplicantMessenger怎么用?C++ AccountManager::SetReplicantMessenger使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AccountManager
的用法示例。
在下文中一共展示了AccountManager::SetReplicantMessenger方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ImMessage
filter_result
Server::Filter(BMessage* message, BHandler **target)
{
filter_result result = B_DISPATCH_MESSAGE;
switch (message->what) {
case IM_MESSAGE_RECEIVED:
{
BString id = message->FindString("id");
if (id.Length() > 0) {
bool found = false;
ContactLinker* item = fRosterMap.ValueFor(id, &found);
if (found) {
ChatWindow* win = item->GetChatWindow();
item->ShowWindow();
win->PostMessage(message);
}
}
result = B_SKIP_MESSAGE;
break;
}
case CAYA_CLOSE_CHAT_WINDOW:
{
BString id = message->FindString("id");
if (id.Length() > 0) {
bool found = false;
ContactLinker* item = fRosterMap.ValueFor(id, &found);
if (found)
item->HideWindow();
}
result = B_SKIP_MESSAGE;
break;
}
case IM_MESSAGE:
result = ImMessage(message);
break;
case CAYA_REPLICANT_MESSENGER:
{
BMessenger* messenger = new BMessenger();
status_t ret = message->FindMessenger(
"messenger", messenger);
if (ret != B_OK || !messenger->IsValid()) {
message->PrintToStream();
printf("err %s\n", strerror(ret));
break;
}
AccountManager* accountManager = AccountManager::Get();
accountManager->SetReplicantMessenger(messenger);
accountManager->ReplicantStatusNotify(accountManager->Status());
break;
}
default:
// Dispatch not handled messages to main window
break;
}
return result;
}