soc.2009.transport: e7a0f127: Preparing for purple_notify_message.

hanzz at soc.pidgin.im hanzz at soc.pidgin.im
Fri Jun 26 01:45:22 EDT 2009


-----------------------------------------------------------------
Revision: e7a0f127ede8543b4e382f9890f3a0964b31483b
Ancestor: 833b128159ed7640f5bc52267549581e704448cc
Author: hanzz at soc.pidgin.im
Date: 2009-06-24T19:12:14
Branch: im.pidgin.soc.2009.transport
URL: http://d.pidgin.im/viewmtn/revision/info/e7a0f127ede8543b4e382f9890f3a0964b31483b

Modified files:
        adhochandler.cpp main.cpp

ChangeLog: 

Preparing for purple_notify_message.

-------------- next part --------------
============================================================
--- adhochandler.cpp	73823e6a0d046f49df17b59161348fb02a829529
+++ adhochandler.cpp	491dd8be979373ef53d6db37699342819df2218f
@@ -127,6 +127,7 @@ bool GlooxAdhocHandler::handleIq( const 
 	Tag *stanzaTag = stanza.tag();
 	if (!stanzaTag) return false;
 	Tag *tag = stanzaTag->findChild( "command" );
+	if (!tag) { Log().Get("GlooxAdhocHandler") << "No Node!"; return false; }
 	const std::string& node = tag->findAttribute( "node" );
 	if (node.empty()) {
 		delete stanzaTag;
============================================================
--- main.cpp	1259a601d235276da055d88c795b4f3f88f4a7c1
+++ main.cpp	558ffcc1a4833fe3938af5b3b65ad0b00d4e9368
@@ -392,6 +392,18 @@ static void * notifyEmail(PurpleConnecti
 	return NULL;
 }
 
+static void * notifyMessage(PurpleNotifyMsgType type, const char *title, const char *primary, const char *secondary) {
+// 	User *user = GlooxMessageHandler::instance()->userManager()->getUserByAccount(account);
+// 	if (user && !user->adhocData().id.empty()) {
+// 		AdhocRepeater *repeater = new AdhocRepeater(GlooxMessageHandler::instance(), user, title ? std::string(title):std::string(), primary ? std::string(primary):std::string(), secondary ? std::string(secondary):std::string(), default_action, user_data, action_count, actions);
+// 		GlooxMessageHandler::instance()->adhoc()->registerSession(user->adhocData().from, repeater);
+// 		AdhocData data;
+// 		data.id="";
+// 		user->setAdhocData(data);
+// 		return repeater;
+// 	}
+}
+
 static void buddyListAddBuddy(PurpleAccount *account, const char *username, const char *group, const char *alias){
 	std::cout << "BUDDY LIST ADD BUDDY REQUEST\n";
 }
@@ -402,7 +414,7 @@ static PurpleNotifyUiOps notifyUiOps =
 
 static PurpleNotifyUiOps notifyUiOps =
 {
-		NULL,
+		notifyMessage,
 		notifyEmail,
 		NULL,
 		NULL,
@@ -1005,7 +1017,6 @@ void GlooxMessageHandler::notifyEmail(Pu
 	}
 }
 
-
 void GlooxMessageHandler::purpleConversationWriteChat(PurpleConversation *conv, const char *who, const char *message, PurpleMessageFlags flags, time_t mtime){
 	if (who==NULL)
 		return;


More information about the Commits mailing list