Changeset - 2836f390b953
[Not reviewed]
0 2 0
HanzZ - 14 years ago 2011-06-19 20:40:27
hanzz.k@gmail.com
Receive VCard from PurpleAccount and fixed crash on disconnect
2 files changed with 14 insertions and 2 deletions:
0 comments (0 inline, 0 general)
backends/libpurple/main.cpp
Show inline comments
 
@@ -692,19 +692,29 @@ static void *notify_user_info(PurpleConnection *gc, const char *who, PurpleNotif
 
			displayname = purple_account_get_name_for_display(account);
 
		}
 

	
 
		if (displayname) {
 
			nickname = displayname;
 
		}
 

	
 
		// avatar
 
		PurpleStoredImage *avatar = purple_buddy_icons_find_account_icon(account);
 
		if (avatar) {
 
			const gchar * data = (const gchar *) purple_imgstore_get_data(avatar);
 
			size_t len = purple_imgstore_get_size(avatar);
 
			if (len < 300000 && data) {
 
				photo = Swift::createByteArray(data, len);
 
			}
 
		}
 
	}
 

	
 
	if ((!firstName.empty() || !lastName.empty()) && fullName.empty())
 
		fullName = firstName + " " + lastName;
 

	
 
	PurpleBuddy *buddy = purple_find_buddy(purple_connection_get_account(gc), who);
 
	if (buddy) {
 
	if (buddy && photo.size() == 0) {
 
		gsize len;
 
		PurpleBuddyIcon *icon = NULL;
 
		icon = purple_buddy_icons_find(purple_connection_get_account(gc), name.c_str());
 
		if (icon) {
 
			const gchar * data = (gchar*)purple_buddy_icon_get_data(icon, &len);
 
			// Sometimes libpurple returns really broken pointers here
include/Swiften/Server/Server.cpp
Show inline comments
 
@@ -54,13 +54,15 @@ Server::~Server() {
 
	stop();
 
	delete iqRouter_;
 
	delete stanzaChannel_;
 
}
 

	
 
void Server::start() {
 
	assert(!serverFromClientConnectionServer);
 
	if (serverFromClientConnectionServer) {
 
		return;
 
	}
 
	serverFromClientConnectionServer = networkFactories_->getConnectionServerFactory()->createConnectionServer(port_);
 
	serverFromClientConnectionServerSignalConnections.push_back(
 
		serverFromClientConnectionServer->onNewConnection.connect(
 
				boost::bind(&Server::handleNewClientConnection, this, _1)));
 
// 	serverFromClientConnectionServerSignalConnections.push_back(
 
// 		serverFromClientConnectionServer->onStopped.connect(
0 comments (0 inline, 0 general)