/** * XMPP - libpurple transport * * Copyright (C) 2009, Jan Kaluza <hanzz@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 SPECTRUM_BUDDY_H#define SPECTRUM_BUDDY_H#include<string>#include<algorithm>#include"transport/buddy.h"#include"transport/rostermanager.h"namespaceTransport{classLocalBuddy:publicBuddy{public:LocalBuddy(RosterManager*rosterManager,longid,conststd::string&name,conststd::string&alias="",conststd::vector<std::string>&groups=std::vector<std::string>(),BuddyFlagflags=BUDDY_NO_FLAG);virtual~LocalBuddy();std::stringgetAlias(){returnm_alias;}voidsetAlias(conststd::string&alias);std::stringgetName(){returnm_name;}boolsetName(conststd::string&name);boolgetStatus(Swift::StatusShow&status,std::string&statusMessage){status=m_status;statusMessage=m_statusMessage;returntrue;}voidsetStatus(constSwift::StatusShow&status,conststd::string&statusMessage){m_status=status;m_statusMessage=statusMessage;}std::stringgetIconHash(){returnm_iconHash;}voidsetIconHash(conststd::string&iconHash){boolchanged=m_iconHash!=iconHash;m_iconHash=iconHash;if(changed)getRosterManager()->storeBuddy(this);}std::vector<std::string>getGroups(){returnm_groups;}voidsetGroups(conststd::vector<std::string>&groups);boolisValid(){std::stringsafeName=getSafeName();returnm_jid.isValid()&&safeName.find("/")==std::string::npos;}private:std::stringm_name;std::stringm_alias;std::vector<std::string>m_groups;std::stringm_statusMessage;std::stringm_iconHash;Swift::StatusShowm_status;};}#endif