soc.2009.transport: 82dbdc88: Using correct way to get status message ...

hanzz at soc.pidgin.im hanzz at soc.pidgin.im
Mon Apr 27 14:31:17 EDT 2009


-----------------------------------------------------------------
Revision: 82dbdc88114c43b945d60f04da3368e07df7c693
Ancestor: 66f70d1ffb113508352350bcc303ef25de3fbe69
Author: hanzz at soc.pidgin.im
Date: 2009-04-27T18:25:18
Branch: im.pidgin.soc.2009.transport
URL: http://d.pidgin.im/viewmtn/revision/info/82dbdc88114c43b945d60f04da3368e07df7c693

Modified files:
        user.cpp

ChangeLog: 

Using correct way to get status message from prpl.

-------------- next part --------------
============================================================
--- user.cpp	88e09dd6447984cdfee116b004b934dad843d1ff
+++ user.cpp	7c4f15e79b910b681f3d45f9652ac389901e7d9a
@@ -218,8 +218,15 @@ Tag *User::generatePresenceStanza(Purple
 	if (stat==NULL)
 		return NULL;
 	int s = purple_status_type_get_primitive(purple_status_get_type(stat));
-	const char *statusMessage = purple_status_get_attr_string(stat, "message");
+	char *text = NULL;
+	char *statusMessage = NULL;
 
+	PurplePluginProtocolInfo *prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(purple_account_get_connection(m_account)->prpl);
+
+	if (prpl_info && prpl_info->status_text) {
+		statusMessage = prpl_info->status_text(buddy);
+	}
+
 	Log().Get(m_jid) << "Generating presence stanza for user " << name;
 	Tag *tag = new Tag("presence");
 	std::string from;
@@ -232,6 +239,7 @@ Tag *User::generatePresenceStanza(Purple
 		std::string _status(statusMessage);
 		Log().Get(m_jid) << "Raw status message: " << _status;
 		tag->addChild( new Tag("status", stripHTMLTags(_status)));
+		g_free(statusMessage);
 	}
 	
 	switch(s) {


More information about the Commits mailing list