本文整理汇总了C++中ContactRef::get方法的典型用法代码示例。如果您正苦于以下问题:C++ ContactRef::get方法的具体用法?C++ ContactRef::get怎么用?C++ ContactRef::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ContactRef
的用法示例。
在下文中一共展示了ContactRef::get方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SignalSearchResultEvent
/* search_result */
void WPclient::SignalSearchResultEvent(SearchResultEvent *ev) {
meta_gen meta;
if (search_ev == ev) {
UIN_t uin;
if (sesja->pend_search == NULL) {
log_alert(ZONE,"No search at session");
search_ev = NULL;
return;
}
if (!ev->isExpired()) {
// ContactList& cl = ev->getContactList();
ContactRef c = ev->getLastContactAdded();
if (c.get() != NULL) {
uin = c->getUIN();
meta.nick = (char*)c->getAlias().c_str();
meta.first = (char*)c->getFirstName().c_str();
meta.last = (char*)c->getLastName().c_str();
meta.email = (char*)c->getEmail().c_str();
if (c->getAuthReq()) {
meta.auth = 1;
} else {
meta.auth = 0;
}
switch (c->getStatus())
{
case STATUS_OFFLINE:
meta.status = ICQ_STATUS_OFFLINE;
break;
case STATUS_AWAY:
meta.status = ICQ_STATUS_AWAY;
break;
case STATUS_DND:
meta.status = ICQ_STATUS_DND;
break;
case STATUS_NA:
meta.status = ICQ_STATUS_NA;
break;
case STATUS_OCCUPIED:
meta.status = ICQ_STATUS_NA;
break;
case STATUS_FREEFORCHAT:
meta.status = ICQ_STATUS_FREE_CHAT;
break;
default:
meta.status = ICQ_STATUS_ONLINE;
break;
}
log_debug(ZONE,"Search enter part");
(*(meta_search_cb)sesja->pend_search->cb)
(sesja,uin,&meta,sesja->pend_search->arg);
}
}
else {
log_alert(ZONE,"search timedout");
uin = 0;
}
if (ev->isFinished()) {
log_debug(ZONE,"Search send");
(*(meta_search_cb)sesja->pend_search->cb)
(sesja,uin,NULL,sesja->pend_search->arg);
search_ev = NULL;
sesja->pend_search = NULL;
}
}
else {
log_alert(ZONE,"Not our search event search_ev= %p",search_ev);
}
}