soc.2009.transport: 3c2fb48e: Using PurpleStatus instead of PurpleSave...
hanzz at soc.pidgin.im
hanzz at soc.pidgin.im
Wed Jul 29 08:55:57 EDT 2009
-----------------------------------------------------------------
Revision: 3c2fb48e2f35b77ecd10f3c6a979d05507ffa733
Ancestor: 352541a5f1b80f39b5e40ee493ecbbdce8085fea
Author: hanzz at soc.pidgin.im
Date: 2009-07-29T12:49:22
Branch: im.pidgin.soc.2009.transport
URL: http://d.pidgin.im/viewmtn/revision/info/3c2fb48e2f35b77ecd10f3c6a979d05507ffa733
Modified files:
user.cpp
ChangeLog:
Using PurpleStatus instead of PurpleSavedStatus because of much more better performance
-------------- next part --------------
============================================================
--- user.cpp 1ef6a03d7cd404788394ef986f637278c1c963a9
+++ user.cpp ed766d46c4b49b535711ac18e94334fa1cd4b204
@@ -1179,8 +1179,8 @@ void User::receivedPresence(const Presen
else {
Log().Get(m_jid) << "mirroring presence to legacy network";
// we are already connected so we have to change status
- PurpleSavedStatus *status;
int PurplePresenceType;
+ const PurpleStatusType *status_type;
std::string statusMessage;
// mirror presence types
@@ -1207,21 +1207,26 @@ void User::receivedPresence(const Presen
}
default: break;
}
- // send presence to our legacy network
- status = purple_savedstatus_new(NULL, (PurpleStatusPrimitive)PurplePresenceType);
+
+ status_type = purple_account_get_status_type_with_primitive(m_account, (PurpleStatusPrimitive)PurplePresenceType);
+ if (status_type != NULL) {
+ // send presence to legacy network
+ statusMessage.clear();
- statusMessage.clear();
+ if (hasTransportFeature(TRANSPORT_MANGLE_STATUS)) {
+ p->sql()->getRandomStatus(statusMessage);
+ statusMessage.append(" - ");
+ }
- if (hasTransportFeature(TRANSPORT_MANGLE_STATUS)) {
- p->sql()->getRandomStatus(statusMessage);
- statusMessage.append(" - ");
- }
+ statusMessage.append(stanza.status());
- statusMessage.append(stanza.status());
-
- if (!statusMessage.empty())
- purple_savedstatus_set_message(status,statusMessage.c_str());
- purple_savedstatus_activate_for_account(status,m_account);
+ if (!statusMessage.empty()) {
+ purple_account_set_status(m_account, purple_status_type_get_id(status_type), TRUE, "message", statusMessage.c_str(), NULL);
+ }
+ else {
+ purple_account_set_status(m_account, purple_status_type_get_id(status_type), TRUE, NULL);
+ }
+ }
}
}
More information about the Commits
mailing list