Changeset - b668b4552287
[Not reviewed]
0 1 0
HanzZ - 14 years ago 2011-06-19 15:25:46
hanzz.k@gmail.com
handle all important VCard labels for ICQ
1 file changed with 3 insertions and 3 deletions:
0 comments (0 inline, 0 general)
backends/libpurple/main.cpp
Show inline comments
 
@@ -635,55 +635,55 @@ static PurpleConnectionUiOps conn_ui_ops =
 
	NULL,
 
	connection_report_disconnect,
 
	NULL,
 
	NULL,
 
	NULL
 
};
 

	
 
static void *notify_user_info(PurpleConnection *gc, const char *who, PurpleNotifyUserInfo *user_info) {
 
	std::string name(who);
 
	PurpleAccount *account = purple_connection_get_account(gc);
 
	GList *vcardEntries = purple_notify_user_info_get_entries(user_info);
 
	PurpleNotifyUserInfoEntry *vcardEntry;
 
	std::string firstName;
 
	std::string lastName;
 
	std::string fullName;
 
	std::string nickname;
 
	std::string header;
 
	std::string label;
 
	Swift::ByteArray photo;
 

	
 
	while (vcardEntries) {
 
		vcardEntry = (PurpleNotifyUserInfoEntry *)(vcardEntries->data);
 
		if (purple_notify_user_info_entry_get_label(vcardEntry) && purple_notify_user_info_entry_get_value(vcardEntry)){
 
			label = purple_notify_user_info_entry_get_label(vcardEntry);
 
			if (label == "Given Name") {
 
			if (label == "Given Name" || label == "First Name") {
 
				firstName = purple_notify_user_info_entry_get_value(vcardEntry);
 
			}
 
			else if (label == "Family Name") {
 
			else if (label == "Family Name" || label == "Last Name") {
 
				lastName = purple_notify_user_info_entry_get_value(vcardEntry);
 
			}
 
			else if (label=="Nickname") {
 
			else if (label=="Nickname" || label == "Nick") {
 
				nickname = purple_notify_user_info_entry_get_value(vcardEntry);
 
			}
 
			else if (label=="Full Name") {
 
				fullName = purple_notify_user_info_entry_get_value(vcardEntry);
 
			}
 
			else {
 
				std::cout << "UNHANDLED VCARD LABEL '" << purple_notify_user_info_entry_get_label(vcardEntry) << "' " << purple_notify_user_info_entry_get_value(vcardEntry) << "\n";
 
			}
 
		}
 
		vcardEntries = vcardEntries->next;
 
	}
 

	
 
	if (name == purple_account_get_username(account)) {
 
		const gchar *displayname = purple_connection_get_display_name(gc);
 
		if (!displayname) {
 
			displayname = purple_account_get_name_for_display(account);
 
		}
 

	
 
		if (displayname) {
 
			nickname = displayname;
 
		}
 
	}
 

	
 
	if ((!firstName.empty() || !lastName.empty()) && fullName.empty())
0 comments (0 inline, 0 general)