1 /*
2  * This file is part of Licq, an instant messaging client for UNIX.
3  * Copyright (C) 2012-2013 Licq developers <licq-dev@googlegroups.com>
4  *
5  * Licq is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * Licq is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with Licq; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18  */
19 
20 #include "user.h"
21 
22 #include <licq/inifile.h>
23 #include <licq/socket.h>
24 
25 using namespace LicqMsn;
26 
User(const Licq::UserId & id,bool temporary)27 User::User(const Licq::UserId& id, bool temporary)
28   : Licq::User(id, temporary),
29     myNormalSocketDesc(NULL),
30     myInfoSocketDesc(NULL)
31 {
32   Licq::IniFile& conf(userConf());
33   conf.get("PictureObject", myPictureObject);
34 }
35 
~User()36 User::~User()
37 {
38   // Empty
39 }
40 
savePictureInfo()41 void User::savePictureInfo()
42 {
43   Licq::User::savePictureInfo();
44 
45   Licq::IniFile& conf(userConf());
46   conf.set("PictureObject", myPictureObject);
47 }
48 
clearSocketDesc(Licq::INetSocket * s)49 void User::clearSocketDesc(Licq::INetSocket* s)
50 {
51   if (s == NULL || s == myNormalSocketDesc)
52     myNormalSocketDesc = NULL;
53   if (s == NULL || s == myInfoSocketDesc)
54     myInfoSocketDesc = NULL;
55 }
56