aboutsummaryrefslogtreecommitdiffstats
path: root/protocols
diff options
context:
space:
mode:
Diffstat (limited to 'protocols')
-rw-r--r--protocols/Makefile2
-rw-r--r--protocols/account.c5
-rw-r--r--protocols/nogaim.c12
-rw-r--r--protocols/nogaim.h4
-rw-r--r--protocols/unknown.c75
5 files changed, 6 insertions, 92 deletions
diff --git a/protocols/Makefile b/protocols/Makefile
index ae969bde..b4565ab6 100644
--- a/protocols/Makefile
+++ b/protocols/Makefile
@@ -12,7 +12,7 @@ _SRCDIR_ := $(_SRCDIR_)protocols/
endif
# [SH] Program variables
-objects = account.o bee.o bee_chat.o bee_ft.o bee_user.o nogaim.o unknown.o
+objects = account.o bee.o bee_chat.o bee_ft.o bee_user.o nogaim.o
# [SH] The next two lines should contain the directory name (in $(subdirs))
diff --git a/protocols/account.c b/protocols/account.c
index aa14b0c3..aa1ffe61 100644
--- a/protocols/account.c
+++ b/protocols/account.c
@@ -77,6 +77,11 @@ account_t *account_add(bee_t *bee, struct prpl *prpl, char *user, char *pass)
set_add(&a->set, "offline_user_quits", "true", set_eval_bool, a);
set_add(&a->set, "offline_is_away", "false", set_eval_bool, a);
+ if (prpl == &protocol_missing) {
+ s = set_add(&a->set, "server", NULL, set_eval_account, a);
+ s->flags |= SET_NOSAVE | SET_HIDDEN | ACC_SET_OFFLINE_ONLY | ACC_SET_ONLINE_ONLY;
+ }
+
/* Hardcode some more clever tag guesses. */
strcpy(tag, prpl->name);
if (strcmp(prpl->name, "oscar") == 0) {
diff --git a/protocols/nogaim.c b/protocols/nogaim.c
index 18967e67..5035a156 100644
--- a/protocols/nogaim.c
+++ b/protocols/nogaim.c
@@ -159,7 +159,6 @@ GList *get_plugins()
GList *protocols = NULL;
GList *disabled_protocols = NULL;
-static struct prpl *unknown_prpl;
void register_protocol(struct prpl *p)
{
@@ -191,14 +190,6 @@ struct prpl *find_protocol(const char *name)
return gl ? gl->data: NULL;
}
-struct prpl *make_unknown_protocol(const char *name)
-{
- struct prpl *ret = g_memdup(unknown_prpl, sizeof(struct prpl));
- ret->name = g_strdup(name);
- register_protocol(ret);
- return ret;
-}
-
gboolean is_protocol_disabled(const char *name)
{
return g_list_find_custom(disabled_protocols, name, proto_name_cmp) != NULL;
@@ -249,9 +240,6 @@ void nogaim_init()
extern void jabber_initmodule();
extern void twitter_initmodule();
extern void purple_initmodule();
- extern void unknown_prpl_initmodule();
-
- unknown_prpl_initmodule(&unknown_prpl);
#ifdef WITH_MSN
msn_initmodule();
diff --git a/protocols/nogaim.h b/protocols/nogaim.h
index 3aa89c3b..8e6c9d5a 100644
--- a/protocols/nogaim.h
+++ b/protocols/nogaim.h
@@ -158,9 +158,6 @@ typedef enum {
/* The protocol is not suitable for OTR, see OPT_NOOTR */
PRPL_OPT_NOOTR = 1 << 12,
-
- /* This prpl is a placeholder for a missing protocol */
- PRPL_OPT_UNKNOWN_PROTOCOL = 1 << 13,
} prpl_options_t;
struct prpl {
@@ -323,7 +320,6 @@ G_MODULE_EXPORT GList *get_protocols_disabled();
G_MODULE_EXPORT GSList *get_connections();
G_MODULE_EXPORT struct prpl *find_protocol(const char *name);
G_MODULE_EXPORT gboolean is_protocol_disabled(const char *name);
-G_MODULE_EXPORT struct prpl *make_unknown_protocol(const char *name);
G_MODULE_EXPORT char *explain_unknown_protocol(const char *name);
/* When registering a new protocol, you should allocate space for a new prpl
* struct, initialize it (set the function pointers to point to your
diff --git a/protocols/unknown.c b/protocols/unknown.c
deleted file mode 100644
index 105b2f62..00000000
--- a/protocols/unknown.c
+++ /dev/null
@@ -1,75 +0,0 @@
-/********************************************************************\
- * BitlBee -- An IRC to other IM-networks gateway *
- * *
- * Copyright 2002-2016 Wilmer van der Gaast and others *
- \********************************************************************/
-
-/*
- 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 with
- the Debian GNU/Linux distribution in /usr/share/common-licenses/GPL;
- if not, write to the Free Software Foundation, Inc., 51 Franklin St.,
- Fifth Floor, Boston, MA 02110-1301 USA
-*/
-
-#define BITLBEE_CORE
-#include "nogaim.h"
-
-/* Displays an error when trying to connect this account */
-static void unknown_prpl_login(account_t *acc)
-{
- struct im_connection *ic = imcb_new(acc);
- char *msg;
-
- imcb_error(ic, "Unknown protocol");
-
- msg = explain_unknown_protocol(acc->prpl->name);
- imcb_error(ic, "%s", msg);
- g_free(msg);
-
- imc_logout(ic, FALSE);
-}
-
-/* Required, no-op */
-static void unknown_prpl_logout(struct im_connection *ic)
-{
-}
-
-/* Needed to ensure the server setting is preserved */
-static void unknown_prpl_init(account_t *acc)
-{
- set_t *s;
-
- s = set_add(&acc->set, "server", NULL, set_eval_account, acc);
- s->flags |= SET_NOSAVE | ACC_SET_OFFLINE_ONLY | SET_NULL_OK;
-}
-
-/* Needed to silence warnings about named groupchats not supported */
-struct groupchat *unknown_prpl_chat_join(struct im_connection *ic, const char *room, const char *nick, const char *password,
- set_t **sets)
-{
- return NULL;
-}
-
-void unknown_prpl_initmodule(struct prpl **prpl)
-{
- struct prpl *ret = g_new0(struct prpl, 1);
-
- ret->name = "unknown";
- ret->options = PRPL_OPT_UNKNOWN_PROTOCOL | PRPL_OPT_NOOTR;
- ret->login = unknown_prpl_login;
- ret->logout = unknown_prpl_logout;
- ret->init = unknown_prpl_init;
- ret->chat_join = unknown_prpl_chat_join;
- *prpl = ret;
-}
-