soc.2009.transport: 57876542: Clean code in user.cpp. user.h . Added G...

hanzz at soc.pidgin.im hanzz at soc.pidgin.im
Fri Apr 24 12:15:44 EDT 2009


-----------------------------------------------------------------
Revision: 578765420f7b57f40bf3c3397c3ec7a565e1edb4
Ancestor: e2f0d7fceac5155cf633364a74622505307f45eb
Author: hanzz at soc.pidgin.im
Date: 2009-04-24T16:14:35
Branch: im.pidgin.soc.2009.transport
URL: http://d.pidgin.im/viewmtn/revision/info/578765420f7b57f40bf3c3397c3ec7a565e1edb4

Modified files:
        autoconnectloop.cpp autoconnectloop.h caps.cpp caps.h
        cmake_install.cmake discoinfohandler.cpp discoinfohandler.h
        filetransfermanager.cpp filetransfermanager.h
        gatewayhandler.cpp gatewayhandler.h geventloop.cpp
        geventloop.h main.cpp main.h protocols/abstractprotocol.h
        protocols/facebook.cpp protocols/facebook.h
        protocols/icq.cpp protocols/icq.h receivefile.cpp
        receivefile.h registerhandler.cpp registerhandler.h
        sendfile.cpp sendfile.h sql.cpp sql.h statshandler.cpp
        statshandler.h striphtmltags.cpp striphtmltags.h thread.cpp
        thread.h user.cpp user.h usermanager.cpp usermanager.h
        vcardhandler.cpp vcardhandler.h xpinghandler.cpp
        xpinghandler.h

ChangeLog: 

Clean code in user.cpp. user.h . Added GPL2 license header to all files.

-------------- next part --------------
============================================================
--- autoconnectloop.cpp	1ce731ab395f9478f9fa56c79a3f52cc26a5e0a7
+++ autoconnectloop.cpp	75f031272c82b4532c22f428679fb889d00cb7f4
@@ -1,3 +1,23 @@
+/**
+ * XMPP - libpurple transport
+ *
+ * Copyright (C) 2009, Jan Kaluza <hanzz at soc.pidgin.im>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ */
+
 #include "autoconnectloop.h"
 #include "main.h"
 #include "log.h"
============================================================
--- autoconnectloop.h	187c4846c1d70cd338a29c30454a83b4a0faf52a
+++ autoconnectloop.h	314a85e595c49a7738f5dcbc8934a1cff48b24f3
@@ -1,3 +1,23 @@
+/**
+ * XMPP - libpurple transport
+ *
+ * Copyright (C) 2009, Jan Kaluza <hanzz at soc.pidgin.im>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ */
+
 #ifndef AUTOCONNECTLOOP_H
 #define AUTOCONNECTLOOP_H
 
============================================================
--- caps.cpp	323e39c4bdd5bb1481d8616c99900cd2fdd63d26
+++ caps.cpp	e63f4326874e736659c34508fb544daf3e475a76
@@ -1,3 +1,23 @@
+/**
+ * XMPP - libpurple transport
+ *
+ * Copyright (C) 2009, Jan Kaluza <hanzz at soc.pidgin.im>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ */
+
 #include "caps.h"
 #include <gloox/clientbase.h>
 #include <glib.h>
@@ -56,9 +76,9 @@ void GlooxDiscoHandler::handleDiscoInfoR
 		std::cout << "no user?! wtf...";
 	}
 	else{
-		if (user->capsVersion.empty()){
-			user->capsVersion=versions[stanza->id()];
-			if (user->readyForConnect)
+		if (user->capsVersion().empty()){
+			user->setCapsVersion(versions[stanza->id()]);
+			if (user->readyForConnect())
 				user->connect();
 		}
 	}
@@ -88,9 +108,9 @@ void GlooxDiscoHandler::handleDiscoError
 		std::cout << "no user?! wtf...";
 	}
 	else{
-		if (user->capsVersion.empty()){
-			user->capsVersion=versions[stanza->id()];
-			if (user->readyForConnect)
+		if (user->capsVersion().empty()){
+			user->setCapsVersion(versions[stanza->id()]);
+			if (user->readyForConnect())
 				user->connect();
 		}
 	}
============================================================
--- caps.h	7cee5ed814714a6eecdbe847adf59effba11daba
+++ caps.h	6e221babafea8f5b312ad8a9bf169209bf87bfa8
@@ -1,3 +1,23 @@
+/**
+ * XMPP - libpurple transport
+ *
+ * Copyright (C) 2009, Jan Kaluza <hanzz at soc.pidgin.im>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ */
+
 #ifndef _HI_CAPS_H
 #define _HI_CAPS_H
 
============================================================
--- cmake_install.cmake	e628490d9712f312d28cb1fb9340d6b2bb02b72d
+++ cmake_install.cmake	3f38563542e35482bd056cd4455cc6221d23cf17
@@ -1,4 +1,4 @@
-# Install script for directory: /home/hanzz/icq/hiicq
+# Install script for directory: /home/hanzz/code/transport
 
 # Set the install prefix
 IF(NOT DEFINED CMAKE_INSTALL_PREFIX)
@@ -38,7 +38,7 @@ ENDIF(CMAKE_INSTALL_COMPONENT)
   SET(CMAKE_INSTALL_MANIFEST "install_manifest.txt")
 ENDIF(CMAKE_INSTALL_COMPONENT)
 
-FILE(WRITE "/home/hanzz/icq/hiicq/${CMAKE_INSTALL_MANIFEST}" "")
+FILE(WRITE "/home/hanzz/code/transport/${CMAKE_INSTALL_MANIFEST}" "")
 FOREACH(file ${CMAKE_INSTALL_MANIFEST_FILES})
-  FILE(APPEND "/home/hanzz/icq/hiicq/${CMAKE_INSTALL_MANIFEST}" "${file}\n")
+  FILE(APPEND "/home/hanzz/code/transport/${CMAKE_INSTALL_MANIFEST}" "${file}\n")
 ENDFOREACH(file)
============================================================
--- discoinfohandler.cpp	d737aa3b369dc3380ea8ccfcd5edbf8d4c566b01
+++ discoinfohandler.cpp	e5f47a8984ce6fc03501b74da1496414506525f1
@@ -1,3 +1,23 @@
+/**
+ * XMPP - libpurple transport
+ *
+ * Copyright (C) 2009, Jan Kaluza <hanzz at soc.pidgin.im>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ */
+
 #include "discoinfohandler.h"
 #include "protocols/abstractprotocol.h"
 
============================================================
--- discoinfohandler.h	2efc0ac88d07f6a880c1a3a14904bc16ab6645d1
+++ discoinfohandler.h	957e8460abbd85e9417f617f13ca0cecc64d79d8
@@ -1,3 +1,23 @@
+/**
+ * XMPP - libpurple transport
+ *
+ * Copyright (C) 2009, Jan Kaluza <hanzz at soc.pidgin.im>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ */
+
 #ifndef _HI_DISCOINFO_H
 #define _HI_DISCOINFO_H
 
============================================================
--- filetransfermanager.cpp	42bd6c4142cb6557f804c011cf3c78d483a734bf
+++ filetransfermanager.cpp	6c8f84c803fc11a3eac9b37f0dbb49a4e137ac00
@@ -1,3 +1,23 @@
+/**
+ * XMPP - libpurple transport
+ *
+ * Copyright (C) 2009, Jan Kaluza <hanzz at soc.pidgin.im>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ */
+
 #include "filetransfermanager.h"
 
 void FileTransferManager::setSIProfileFT(gloox::SIProfileFT *sipft,GlooxMessageHandler *parent) {
============================================================
--- filetransfermanager.h	8600a2d7f73e38f2b9c8a8a6eb62b2e6afd19b23
+++ filetransfermanager.h	84d2b79a8bc7ae0dfce80934a383e3a1fbfa32ff
@@ -1,3 +1,23 @@
+/**
+ * XMPP - libpurple transport
+ *
+ * Copyright (C) 2009, Jan Kaluza <hanzz at soc.pidgin.im>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ */
+
 #ifndef FILETRANSFERMANAGER_H
 #define FILETRANSFERMANAGER_H
 
============================================================
--- gatewayhandler.cpp	068a8665fd80c9c55fa052a9d72e613783f68557
+++ gatewayhandler.cpp	e25fee8e97761d6bd05233827ab7d33467fde409
@@ -1,3 +1,23 @@
+/**
+ * XMPP - libpurple transport
+ *
+ * Copyright (C) 2009, Jan Kaluza <hanzz at soc.pidgin.im>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ */
+
 #include "gatewayhandler.h"
 #include <glib.h>
 #include "main.h"
============================================================
--- gatewayhandler.h	1a870f5a8b5b7adaaad12e8c1342774bdb2261f3
+++ gatewayhandler.h	e6490586b24de43a00904f2fff593ccfa3c995a5
@@ -1,3 +1,23 @@
+/**
+ * XMPP - libpurple transport
+ *
+ * Copyright (C) 2009, Jan Kaluza <hanzz at soc.pidgin.im>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ */
+
 #ifndef _HI_GATEWAY_H
 #define _HI_GATEWAY_H
 
============================================================
--- geventloop.cpp	45a6d62bad34a68f5f9171901a2b651eb5b4ba0d
+++ geventloop.cpp	b77b6f54a53ad22e4844582f465d03e581ee23bc
@@ -1,5 +1,24 @@
-#include "geventloop.h"
+/**
+ * XMPP - libpurple transport
+ *
+ * Copyright (C) 2009, Jan Kaluza <hanzz at soc.pidgin.im>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ */
 
+#include "geventloop.h"
 
 typedef struct _PurpleIOClosure {
 	PurpleInputFunction function;
============================================================
--- geventloop.h	d0f00d5a8f1f374e530df8588a1502a049a8c325
+++ geventloop.h	ad274886c20ec89c022ce99d468e40c0a1ba92d2
@@ -1,3 +1,23 @@
+/**
+ * XMPP - libpurple transport
+ *
+ * Copyright (C) 2009, Jan Kaluza <hanzz at soc.pidgin.im>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ */
+
 #ifndef _HI_EVENTLOOP_H
 #define _HI_EVENTLOOP_H
 
============================================================
--- main.cpp	f912c8b4c298bd7a5dfaffc1f88321acc530f9a2
+++ main.cpp	90d8854f1f8552f9fa479138a171c2c1245d128e
@@ -1,3 +1,23 @@
+/**
+ * XMPP - libpurple transport
+ *
+ * Copyright (C) 2009, Jan Kaluza <hanzz at soc.pidgin.im>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ */
+
 #include "main.h"
 #include "utf8.h"
 #include "log.h"
@@ -334,7 +354,7 @@ static gboolean connectUser(gpointer dat
 static gboolean connectUser(gpointer data){
 	std::string name((char*)data);
 	User *user = GlooxMessageHandler::instance()->userManager()->getUserByJID(name);
-	if (user && user->readyForConnect && !user->connected){
+	if (user && user->readyForConnect() && !user->connected){
 		user->connect();
 	}
 	g_free(data);
@@ -849,7 +869,7 @@ void GlooxMessageHandler::handlePresence
 				user = new User(this, stanza->from().bare(), res.uin, res.password);
 				if (c!=NULL)
 					if(hasCaps(c->findAttribute("ver")))
-						user->capsVersion=capsCache[c->findAttribute("ver")];
+						user->setCapsVersion(c->findAttribute("ver"));
 // 				if (!isVip)
 // 					user->features=features0;
 // 				else
============================================================
--- main.h	c582d774532471e9ce6e0977ba46d347de6d317e
+++ main.h	bb85c6def1be97732b45930eadee2431f37785dc
@@ -1,3 +1,23 @@
+/**
+ * XMPP - libpurple transport
+ *
+ * Copyright (C) 2009, Jan Kaluza <hanzz at soc.pidgin.im>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ */
+
 #ifndef _HI_MAIN_H
 #define _HI_MAIN_H
 
============================================================
--- protocols/abstractprotocol.h	9f62522e045f67bd80b1a8314f7d8bd8cbaf1a7a
+++ protocols/abstractprotocol.h	3e7bb813a75304fa811508c2b916ab27ab09226e
@@ -1,3 +1,23 @@
+/**
+ * XMPP - libpurple transport
+ *
+ * Copyright (C) 2009, Jan Kaluza <hanzz at soc.pidgin.im>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ */
+
 #ifndef _HI_ABSTRACTPROTOCOL_H
 #define _HI_ABSTRACTPROTOCOL_H
 
============================================================
--- protocols/facebook.cpp	d3217168f7206a9a16e26a10e6437257dbb08220
+++ protocols/facebook.cpp	1d2b8a9186488a36614f11143ad933e569d8d83b
@@ -1,3 +1,23 @@
+/**
+ * XMPP - libpurple transport
+ *
+ * Copyright (C) 2009, Jan Kaluza <hanzz at soc.pidgin.im>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ */
+
 #include "facebook.h"
 #include "../main.h"
 
============================================================
--- protocols/facebook.h	abf798d2727915b2d238ff5b92ac366418514ea3
+++ protocols/facebook.h	e9bce1dc0ffc865f867a7aeeb0a2d648c9c8c947
@@ -1,3 +1,23 @@
+/**
+ * XMPP - libpurple transport
+ *
+ * Copyright (C) 2009, Jan Kaluza <hanzz at soc.pidgin.im>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ */
+
 #ifndef _HI_FACEBOOK_PROTOCOL_H
 #define _HI_FACEBOOK_PROTOCOL_H
 
============================================================
--- protocols/icq.cpp	7a580e4191e7dec2a1e4ce1b2760a823f74858a3
+++ protocols/icq.cpp	1f2ffd0abcad7511635cec72b055b04e9e0e64f9
@@ -1,3 +1,23 @@
+/**
+ * XMPP - libpurple transport
+ *
+ * Copyright (C) 2009, Jan Kaluza <hanzz at soc.pidgin.im>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ */
+
 #include "icq.h"
 #include "../main.h"
 
============================================================
--- protocols/icq.h	5597d2e345f89f2796eb9c8f1b9fa32776e23495
+++ protocols/icq.h	526b6c21e1a9977e95f25d464455b0cf377db415
@@ -1,3 +1,23 @@
+/**
+ * XMPP - libpurple transport
+ *
+ * Copyright (C) 2009, Jan Kaluza <hanzz at soc.pidgin.im>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ */
+
 #ifndef _HI_ICQ_PROTOCOL_H
 #define _HI_ICQ_PROTOCOL_H
 
============================================================
--- receivefile.cpp	47aea5076e69a914ba2b8d102d3b0de795d8e095
+++ receivefile.cpp	862e89c33bd0e9c7cc33df0e3725184918560a0c
@@ -1,3 +1,23 @@
+/**
+ * XMPP - libpurple transport
+ *
+ * Copyright (C) 2009, Jan Kaluza <hanzz at soc.pidgin.im>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ */
+
 #include "receivefile.h"
 #include "log.h"
 #include "main.h"
============================================================
--- receivefile.h	d66096228cf5e7469b1eb028b8b8e1f391017aa5
+++ receivefile.h	4098cb1698b5b72b9e543cc2980e9e85c872a6c2
@@ -1,3 +1,23 @@
+/**
+ * XMPP - libpurple transport
+ *
+ * Copyright (C) 2009, Jan Kaluza <hanzz at soc.pidgin.im>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ */
+
 #ifndef RECEIVEFILE_H
 #define RECEIVEFILE_H
 #include "thread.h"
============================================================
--- registerhandler.cpp	a77af8ee959a24e35076a37682cd320c9c392f96
+++ registerhandler.cpp	dcdf63f699417863289d82814e4705a143ad72c0
@@ -1,3 +1,23 @@
+/**
+ * XMPP - libpurple transport
+ *
+ * Copyright (C) 2009, Jan Kaluza <hanzz at soc.pidgin.im>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ */
+
 #include "registerhandler.h"
 #include "main.h"
 #include <gloox/clientbase.h>
============================================================
--- registerhandler.h	4858e06671cd26f2c424e48573debe114d5746f3
+++ registerhandler.h	1e2aede0f4882476596420ba2c272fa58f96da56
@@ -1,3 +1,23 @@
+/**
+ * XMPP - libpurple transport
+ *
+ * Copyright (C) 2009, Jan Kaluza <hanzz at soc.pidgin.im>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ */
+
 #ifndef _HI_CL_H
 #define _HI_CL_H
 
============================================================
--- sendfile.cpp	0a0e3cefbd171371de205f523f6cbf35c35547dd
+++ sendfile.cpp	ff5a9f9086c57be7d58c206fa40a72b381e4fb74
@@ -1,3 +1,23 @@
+/**
+ * XMPP - libpurple transport
+ *
+ * Copyright (C) 2009, Jan Kaluza <hanzz at soc.pidgin.im>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ */
+
 #include "sendfile.h"
 
 SendFile::SendFile(gloox::SOCKS5Bytestream *stream, std::string filename, int size, MyMutex *mutex, FileTransferManager *manager) {
============================================================
--- sendfile.h	8a45b34fb5d7c6a84316f0c169dbc41d2d2024f5
+++ sendfile.h	6114f827483edc266e50af969d39662dd125f171
@@ -1,3 +1,22 @@
+/**
+ * XMPP - libpurple transport
+ *
+ * Copyright (C) 2009, Jan Kaluza <hanzz at soc.pidgin.im>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ */
 
 #ifndef SENDFILE_H
 #define SENDFILE_H
============================================================
--- sql.cpp	7f9195f97c61fca1b60f391063be3faa02c282e3
+++ sql.cpp	2e05680c86c7e511a518046efdda1b8dff84abde
@@ -1,3 +1,23 @@
+/**
+ * XMPP - libpurple transport
+ *
+ * Copyright (C) 2009, Jan Kaluza <hanzz at soc.pidgin.im>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ */
+
 #include "sql.h"
 
 SQLClass::SQLClass(GlooxMessageHandler *parent){
============================================================
--- sql.h	e8ed3e2e714865e1127c4b875fd53e0b3bb3277f
+++ sql.h	51d3a7633c680a16eb216310ab45870ead47897d
@@ -1,3 +1,23 @@
+/**
+ * XMPP - libpurple transport
+ *
+ * Copyright (C) 2009, Jan Kaluza <hanzz at soc.pidgin.im>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ */
+
 #ifndef _HI_SQL_H
 #define _HI_SQL_H
 
============================================================
--- statshandler.cpp	12ce1f40e5aa64d583aa6663d4a2e51ac2f79183
+++ statshandler.cpp	7c3bc387f2179ee448fbfe7511150a224ddd8e97
@@ -1,3 +1,23 @@
+/**
+ * XMPP - libpurple transport
+ *
+ * Copyright (C) 2009, Jan Kaluza <hanzz at soc.pidgin.im>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ */
+
 #include "registerhandler.h"
 #include "main.h"
 #include <time.h>
============================================================
--- statshandler.h	b654a89fef34d788c5fb1b9cc88d6d839f73d27a
+++ statshandler.h	5521ba5274cf505114dfa3b0878254ed222c04bd
@@ -1,3 +1,23 @@
+/**
+ * XMPP - libpurple transport
+ *
+ * Copyright (C) 2009, Jan Kaluza <hanzz at soc.pidgin.im>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ */
+
 #ifndef _HI_STATS_H
 #define _HI_STATS_H
 
============================================================
--- striphtmltags.cpp	0069067bc90338be748e1a93fae53b8c32e8e3b2
+++ striphtmltags.cpp	471981079c7772dd80e7027e146a0dfa8d3f0db3
@@ -1,3 +1,23 @@
+/**
+ * XMPP - libpurple transport
+ *
+ * Copyright (C) 2009, Jan Kaluza <hanzz at soc.pidgin.im>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ */
+
 #include "striphtmltags.h"
 
 std::string& replaceAll(std::string& context, const std::string& from, const std::string& to) {
============================================================
--- striphtmltags.h	e1cb280080b7fa0235ee9266452c8277b7861393
+++ striphtmltags.h	b1a956ae09666eb1bd88ecfa10926a192f00c45a
@@ -1,3 +1,23 @@
+/**
+ * XMPP - libpurple transport
+ *
+ * Copyright (C) 2009, Jan Kaluza <hanzz at soc.pidgin.im>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ */
+
 #ifndef STRIPHTMLTAGS_H
 #define STRIPHTMLTAGS_H
 #include <string>
============================================================
--- thread.cpp	c74423549857f9a70c5a2955da5e96137f618946
+++ thread.cpp	3c301c57070ce931f656c8665174e84f152728a3
@@ -1,3 +1,23 @@
+/**
+ * XMPP - libpurple transport
+ *
+ * Copyright (C) 2009, Jan Kaluza <hanzz at soc.pidgin.im>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ */
+
 #include "thread.h"
 
 
============================================================
--- thread.h	1d7f1fd935a0b8f8fbbc42573fc574ec3598b903
+++ thread.h	5dfd66ecc04c9d2e75669c3e76602eb4a06b4242
@@ -1,3 +1,23 @@
+/**
+ * XMPP - libpurple transport
+ *
+ * Copyright (C) 2009, Jan Kaluza <hanzz at soc.pidgin.im>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ */
+
 #ifndef THREAD_H
 #define THREAD_H
 
============================================================
--- user.cpp	f8fcda8ccd9f68b059dc7bd5ba682b85c27e2c64
+++ user.cpp	e9dce38dca438c72ae55c613a03b78d1db3f62e5
@@ -1,3 +1,23 @@
+/**
+ * XMPP - libpurple transport
+ *
+ * Copyright (C) 2009, Jan Kaluza <hanzz at soc.pidgin.im>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ */
+
 #include "user.h"
 #include "main.h"
 #include "log.h"
@@ -22,25 +42,25 @@ User::User(GlooxMessageHandler *parent, 
 	m_roster = p->sql()->getRosterByJid(m_jid);
 	m_vip = p->sql()->isVIP(m_jid);
 	m_syncTimer = 0;
-	this->readyForConnect=false;
-	this->save_called=false;
+	m_readyForConnect = false;
+	m_rosterXCalled = false;
 	m_account=NULL;
 	this->connectionStart = time(NULL);
-	this->lastCount=-1;
+	m_subscribeLastCount = -1;
 	this->reconnectCount=0;
 	this->features=6; // TODO: I can't be hardcoded
 }
 
 bool User::syncCallback() {
-	Log().Get(jid()) << "sync_cb lastCount: " << lastCount << "cacheSize: " << int(subscribeCache.size());
+	Log().Get(jid()) << "sync_cb lastCount: " << m_subscribeLastCount << "cacheSize: " << int(m_subscribeCache.size());
 	// we have to check, if all users arrived and repeat this call if not
-	if (lastCount==int(subscribeCache.size())){
+	if (m_subscribeLastCount == int(m_subscribeCache.size())) {
 		syncContacts();
 		sendRosterX();
 		return FALSE;
 	}
 	else{
-		lastCount=int(subscribeCache.size());
+		m_subscribeLastCount = int(m_subscribeCache.size());
 		return TRUE;
 	}
 }
@@ -50,9 +70,9 @@ bool User::hasFeature(int feature){
  * otherwise returns false.
  */
 bool User::hasFeature(int feature){
-	if (this->capsVersion.empty())
+	if (m_capsVersion.empty())
 		return false;
-	if (p->capsCache[this->capsVersion]&feature)
+	if (p->capsCache[m_capsVersion]&feature)
 		return true;
 	return false;
 }
@@ -115,9 +135,9 @@ void User::sendRosterX()
  */
 void User::sendRosterX()
 {
-	this->save_called=true;
+	m_rosterXCalled = true;
 	m_syncTimer = 0;
-	if (int(this->subscribeCache.size())==0)
+	if (int(m_subscribeCache.size())==0)
 		return;
 	Log().Get(m_jid) << "Sending rosterX";
 	Tag *tag = new Tag("iq");
@@ -132,8 +152,8 @@ void User::sendRosterX()
 	Tag *item;
 
 	// adding these users to roster db with subscription=ask
-	std::vector<subscribeContact>::iterator it = this->subscribeCache.begin();
-	while(it != this->subscribeCache.end()) {
+	std::vector<subscribeContact>::iterator it = m_subscribeCache.begin();
+	while(it != m_subscribeCache.end()) {
 		if (!(*it).uin.empty()){
 			RosterRow user;
 			user.id=-1;
@@ -158,7 +178,8 @@ void User::sendRosterX()
 	std::cout << tag->xml() << "\n";
 	p->j->send(tag);
 	
-	this->subscribeCache.clear();
+	m_subscribeCache.clear();
+	m_subscribeLastCount = -1;
 }
 
 /*
@@ -318,17 +339,17 @@ void User::purpleBuddyChanged(PurpleBudd
 
 	Log().Get(m_jid) << "purpleBuddyChanged: " << name << " ("<< alias <<") (" << s << ")";
 
-	if (m_syncTimer==0 && !this->save_called){
+	if (m_syncTimer==0 && !m_rosterXCalled){
 		m_syncTimer = purple_timeout_add_seconds(4, sync_cb, this);
 	}
 
 	if (!isInRoster(name,"")){
-		if (!this->save_called && hasFeature(GLOOX_FEATURE_ROSTERX)){
+		if (!m_rosterXCalled && hasFeature(GLOOX_FEATURE_ROSTERX)){
 			subscribeContact c;
 			c.uin=name;
 			c.alias=alias;
 			c.group=(std::string) purple_group_get_name(purple_buddy_get_group(buddy));
-			this->subscribeCache.push_back(c);
+			m_subscribeCache.push_back(c);
 			Log().Get(m_jid) << "Not in roster => adding to rosterX cache";
 		}
 		else {
@@ -341,7 +362,7 @@ void User::purpleBuddyChanged(PurpleBudd
 				c.uin=name;
 				c.alias=alias;
 				c.group=(std::string) purple_group_get_name(purple_buddy_get_group(buddy));
-				this->subscribeCache.push_back(c);
+				m_subscribeCache.push_back(c);
 			}
 			else {
 				Log().Get(m_jid) << "Not in roster => sending subscribe";
@@ -510,7 +531,7 @@ void User::connect(){
  * Called when we're ready to connect (we know caps)
  */
 void User::connect(){
-	Log().Get(m_jid) << "Connecting with caps: " << this->capsVersion;
+	Log().Get(m_jid) << "Connecting with caps: " << m_capsVersion;
 	if (purple_accounts_find(m_username.c_str(), this->p->protocol()->protocol().c_str()) != NULL){
 		Log().Get(m_jid) << "this account already exists";
 		m_account = purple_accounts_find(m_username.c_str(), this->p->protocol()->protocol().c_str());
@@ -525,7 +546,7 @@ void User::connect(){
 		purple_accounts_add(m_account);
 	}
 	this->connectionStart = time(NULL);
-	this->readyForConnect = false;
+	m_readyForConnect = false;
 	purple_account_set_string(m_account,"bind",std::string(m_bindIP).c_str());
 	purple_account_set_string(m_account,"lastUsedJid",std::string(m_jid +"/"+m_resource).c_str());
 	purple_account_set_password(m_account,m_password.c_str());
@@ -728,11 +749,11 @@ void User::receivedPresence(Stanza *stan
 			Log().Get(m_jid) << "resource: " << m_resource;
 			if (!this->connected){
 				// we are not connected to legacy network, so we should do it when disco#info arrive :)
-				Log().Get(m_jid) << "connecting: capsVersion=" << this->capsVersion;
-				if (this->readyForConnect==false){
-					this->readyForConnect=true;
-					if (this->capsVersion.empty()){
-						// caps not arrived yet, so we can't connect...
+				Log().Get(m_jid) << "connecting: capsVersion=" << m_capsVersion;
+				if (m_readyForConnect==false){
+					m_readyForConnect=true;
+					if (m_capsVersion.empty()){
+						// caps not arrived yet, so we can't connect just now and we have to wait for caps
 					}
 					else{
 						connect();
@@ -789,7 +810,7 @@ void User::receivedPresence(Stanza *stan
 		}
 		
 		// send presence about tranport status to user
-		if(this->connected || this->readyForConnect) {
+		if(this->connected || m_readyForConnect) {
 			Stanza *tag = Stanza::createPresenceStanza(m_jid, stanza->status(),stanza->presence());
 			tag->addAttribute( "from", p->jid() );
 			p->j->send( tag );
============================================================
--- user.h	5a5a3794e85e6b76613f0beb12a964378a7ef563
+++ user.h	4ee4fa4242e65cf1f852e12821d2dfdea0d7def3
@@ -1,3 +1,23 @@
+/**
+ * XMPP - libpurple transport
+ *
+ * Copyright (C) 2009, Jan Kaluza <hanzz at soc.pidgin.im>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ */
+
 #ifndef _HI_USER_H
 #define _HI_USER_H
 
@@ -82,14 +102,14 @@ public:
 
 	std::string actionData;
 	time_t connectionStart;
-		
-	bool readyForConnect;
-	bool save_called;
+	
 	int reconnectCount;
-	int lastCount;
 	int features;
-	std::string capsVersion;
 	
+	// Entity Capabilities
+	std::string capsVersion() { return m_capsVersion; }
+	void setCapsVersion(const std::string &capsVersion) { m_capsVersion = capsVersion; }
+	
 	// Authorization requests
 	bool hasAuthRequest(const std::string &name);
 	void removeAuthRequest(const std::string &name);
@@ -100,6 +120,7 @@ public:
 	PurpleAccount *account() { return m_account; }
 	std::map<std::string,int> resources() { return m_resources; }
 	bool isVIP() { return m_vip; }
+	bool readyForConnect() { return m_readyForConnect; }
 	std::string username() { return m_username; }
 	std::string jid() { return m_jid; }
 	std::string resource() { return m_resource; }
@@ -108,17 +129,21 @@ public:
 	private:
 		PurpleAccount *m_account;	// PurpleAccount to which this user is connected
 		guint m_syncTimer;			// timer used for syncing purple buddy list and roster
+		int m_subscribeLastCount;	// number of buddies which was in subscribeCache in previous iteration of m_syncTimer
 		bool m_vip;					// true if the user is VIP
+		bool m_readyForConnect;		// true if the user user wants to connect and we're ready to do it
+		bool m_rosterXCalled;		// true if we are counting buddies for roster X
 		std::string m_bindIP;		// IP address to which libpurple will be binded
 		std::string m_password;		// password used to connect to legacy network
 		std::string m_username;		// legacy network user name
 		std::string m_jid;			// Jabber ID of this user
 		std::string m_resource;		// active resource
+		std::string m_capsVersion;	// caps version of client which connected as first (TODO: this should be changed with active resource)
 		std::map<std::string,RosterRow> m_roster;	// jabber roster of this user
 		std::map<std::string,int> m_resources;	// list of all resources which are connected to the transport
 		std::map<std::string,authRequest> m_authRequests;	// list of authorization requests (holds callbacks and user data)
 		std::map<std::string,PurpleConversation *> m_conversations; // list of opened conversations
-		std::vector<subscribeContact> subscribeCache;	// cache for contacts for roster X
+		std::vector<subscribeContact> m_subscribeCache;	// cache for contacts for roster X
 };
 
 #endif
============================================================
--- usermanager.cpp	54315859553fd19499d455dd5b3a74e3a6bd5ec0
+++ usermanager.cpp	92565c3e4798b48c52c1f8a89b794c6675d7d93c
@@ -1,3 +1,23 @@
+/**
+ * XMPP - libpurple transport
+ *
+ * Copyright (C) 2009, Jan Kaluza <hanzz at soc.pidgin.im>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ */
+
 #include "usermanager.h"
 #include "main.h"
 #include "user.h"
============================================================
--- usermanager.h	7c0d233d6a71bb7d4a1cce34edb54ddcf0f1744f
+++ usermanager.h	ff85a35775345d6681d2f28fd5dcddda091e23d0
@@ -1,3 +1,23 @@
+/**
+ * XMPP - libpurple transport
+ *
+ * Copyright (C) 2009, Jan Kaluza <hanzz at soc.pidgin.im>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ */
+
 #ifndef USERMANAGER_H
 #define USERMANAGER_H
 
============================================================
--- vcardhandler.cpp	04026887ae3a7831e72c193d042a976e54d4e6a6
+++ vcardhandler.cpp	c2b671cdb378bbd5444228332fce05c70908a0a1
@@ -1,3 +1,23 @@
+/**
+ * XMPP - libpurple transport
+ *
+ * Copyright (C) 2009, Jan Kaluza <hanzz at soc.pidgin.im>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ */
+
 #include "vcardhandler.h"
 #include "usermanager.h"
 #include "log.h"
============================================================
--- vcardhandler.h	04b3c1489ce9e63b233c9aa4a5537164d16a8105
+++ vcardhandler.h	de2992a7ebc37962beb475b77a3fde7e07e87bd2
@@ -1,3 +1,23 @@
+/**
+ * XMPP - libpurple transport
+ *
+ * Copyright (C) 2009, Jan Kaluza <hanzz at soc.pidgin.im>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ */
+
 #ifndef _HI_VCARD_H
 #define _HI_VCARD_H
 
============================================================
--- xpinghandler.cpp	986178d71c3695e4678f5e55c62d237d2f455c07
+++ xpinghandler.cpp	c959cde38dfa0b8d48786e546d4a9e5c799bf5f3
@@ -1,3 +1,23 @@
+/**
+ * XMPP - libpurple transport
+ *
+ * Copyright (C) 2009, Jan Kaluza <hanzz at soc.pidgin.im>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ */
+
 #include "xpinghandler.h"
 
 GlooxXPingHandler::GlooxXPingHandler(GlooxMessageHandler *parent) : IqHandler(){
============================================================
--- xpinghandler.h	7911bb17d322909c617dc473f9620ab84564b236
+++ xpinghandler.h	e2940ea610aebdbd406846d047157905aaf1c7c9
@@ -1,3 +1,23 @@
+/**
+ * XMPP - libpurple transport
+ *
+ * Copyright (C) 2009, Jan Kaluza <hanzz at soc.pidgin.im>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ */
+
 #ifndef _HI_XPING_H
 #define _HI_XPING_H
 


More information about the Commits mailing list