Chat-O-Matic/protocols/xmpp/GoogleTalkProtocol.cpp
Jaidyn Ann 3fbe072d42 Generalize protocol settings' GUI templating
A nice templating system is used for account settings dialogues― the
required slots are specified by the protocol, and are reflected in the
settings dialogue.

To generalize this templating system (and eventually use elsewhere),
ProtocolSettings was split into two classes― ProtocolSettings and
ProtocolTemplate.

The CayaProtocol::SettingsTemplate() call was also edited to require a
string parameter, naming the specific template that should be returned.

"account" is used for the account settings dialogue, and other values
are TBA.
2021-06-17 17:02:29 -05:00

75 lines
1.1 KiB
C++

/*
* Copyright 2010, Pier Luigi Fiorini. All rights reserved.
* Distributed under the terms of the GPL v2 License.
*
* Authors:
* Pier Luigi Fiorini, pierluigi.fiorini@gmail.com
*/
#include "GoogleTalkProtocol.h"
#include <Resources.h>
#include <libinterface/BitmapUtils.h>
GoogleTalkProtocol::GoogleTalkProtocol()
: JabberHandler()
{
}
GoogleTalkProtocol::~GoogleTalkProtocol()
{
}
const char*
GoogleTalkProtocol::Signature() const
{
return "gtalk";
}
const char*
GoogleTalkProtocol::FriendlySignature() const
{
return "GTalk";
}
BBitmap*
GoogleTalkProtocol::Icon() const
{
BResources res(fPath.Path());
return IconFromResources(&res, 2, B_LARGE_ICON);
}
BMessage
GoogleTalkProtocol::SettingsTemplate(const char* name)
{
if (name == BString("account"))
return JabberHandler::_SettingsTemplate("Identifier", false);
else
return BMessage();
}
void
GoogleTalkProtocol::OverrideSettings()
{
fServer = "dismail.de";
}
BString
GoogleTalkProtocol::ComposeJID() const
{
BString jid(fUsername);
if (jid.FindLast("@") < 0)
jid << "@dismail.de";
jid << "/" << fResource;
return jid;
}