本文整理汇总了C++中ContactRef::GetPropSkypename方法的典型用法代码示例。如果您正苦于以下问题:C++ ContactRef::GetPropSkypename方法的具体用法?C++ ContactRef::GetPropSkypename怎么用?C++ ContactRef::GetPropSkypename使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ContactRef
的用法示例。
在下文中一共展示了ContactRef::GetPropSkypename方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnContactChanged
void CSkypeProto::OnContactChanged(const ContactRef &contact, int prop)
{
SEString data;
contact->GetPropSkypename(data);
wchar_t *sid = ::mir_utf8decodeW(data);
MCONTACT hContact = this->GetContactBySid(sid);
::mir_free(sid);
SEObject *contactObj = contact.fetch();
if (hContact)
{
switch(prop)
{
case Contact::P_AUTHREQ_TIMESTAMP:
{
uint newTS = 0;
contact->GetPropAuthreqTimestamp(newTS);
DWORD oldTS = this->getDword(hContact, "AuthTS", 0);
if (newTS > oldTS)
this->RaiseAuthRequestEvent(newTS, contact);
}
break;
case Contact::P_AUTHREQUEST_COUNT:
// todo: all authrequests after first should be catch here
this->UpdateContactAuthState(hContact, contact);
break;
case Contact::P_AVAILABILITY:
this->UpdateContactStatus(hContact, contact);
this->UpdateChatUserStatus(contact);
break;
//case CContact::P_AVATAR_IMAGE:
case Contact::P_AVATAR_TIMESTAMP:
this->UpdateProfileAvatar(contactObj, hContact);
break;
//case CContact::P_MOOD_TEXT:
case Contact::P_MOOD_TIMESTAMP:
this->UpdateProfileStatusMessage(contactObj, hContact);
break;
case Contact::P_FULLNAME:
this->UpdateChatUserNick(contact);
break;
case Contact::P_PROFILE_TIMESTAMP:
this->UpdateProfile(contactObj, hContact);
break;
}
}
}
示例2: switch
Poco::SharedPtr<ContactData>
Util::dataFromContact(const ContactRef &contact)
{
/* As we are only interested in some data about the Contact, let's fill
* a small structure with everything we need and then return.
*/
Poco::SharedPtr<ContactData> newData =
Poco::SharedPtr<ContactData>(new ContactData);
newData->canSMS = false;
SEString value;
// Get the Skype Name from the Contact.
Contact::TYPE type;
contact->GetPropType(type);
switch (type) {
case Contact::SKYPE:
contact->GetPropSkypename(value);
break;
case Contact::PSTN:
contact->GetPropPstnnumber(value);
newData->canSMS = true;
break;
default:
value = "Unrecognized";
}
newData->skypeName = value;
// Get the Display Name from the Contact.
contact->GetPropDisplayname(value);
newData->displayName = value;
if (!newData->canSMS) {
// See if the contact has a mobile number set.
contact->GetPropPhoneMobile(value);
if (value.length() > 0)
newData->canSMS = true;
}
/* Get the availability from the Contact and translate it to a readable
* string.
*/
Contact::AVAILABILITY availability;
contact->GetPropAvailability(availability);
std::pair<ContactAvailability, std::string> ret =
convertAvailability(availability);
newData->status = ret.first;
newData->availability = ret.second;
//Get the contact Avatar.
bool hasAvatar = false;
SEBinary rawData;
contact->GetAvatar(hasAvatar, rawData);
// Check if the contact has an avatar and then extract the data from it.
if (hasAvatar)
newData->avatar.assignRaw(rawData.data(), rawData.size());
// Get the contact capabilities.
contact->HasCapability(Contact::CAPABILITY_TEXT, newData->canIM);
newData->canCall = (newData->status != Offline);
newData->canFT = (newData->status != Offline && type == Contact::SKYPE);
return newData;
}