source: protocols/unknown.c @ 11d4123

Last change on this file since 11d4123 was 11d4123, checked in by dequis <dx@…>, at 2016-11-19T08:10:48Z

protocols/unknown: Fix format-security warning

Which is -Werror'd in debian builds

  • Property mode set to 100644
File size: 2.4 KB
RevLine 
[66b7741]1/********************************************************************\
2  * BitlBee -- An IRC to other IM-networks gateway                     *
3  *                                                                    *
4  * Copyright 2002-2016 Wilmer van der Gaast and others                *
5  \********************************************************************/
6
7/*
8  This program is free software; you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation; either version 2 of the License, or
11  (at your option) any later version.
12
13  This program is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  GNU General Public License for more details.
17
18  You should have received a copy of the GNU General Public License with
19  the Debian GNU/Linux distribution in /usr/share/common-licenses/GPL;
20  if not, write to the Free Software Foundation, Inc., 51 Franklin St.,
21  Fifth Floor, Boston, MA  02110-1301  USA
22*/
23
24#define BITLBEE_CORE
25#include "nogaim.h"
26
27/* Displays an error when trying to connect this account */
28static void unknown_prpl_login(account_t *acc)
29{
30        struct im_connection *ic = imcb_new(acc);
31        char *msg;
32
33        imcb_error(ic, "Unknown protocol");
34
35        msg = explain_unknown_protocol(acc->prpl->name);
[11d4123]36        imcb_error(ic, "%s", msg);
[66b7741]37        g_free(msg);
38
39        imc_logout(ic, FALSE);
40}
41
42/* Required, no-op */
43static void unknown_prpl_logout(struct im_connection *ic)
44{
45}
46
47/* Needed to ensure the server setting is preserved */
48static void unknown_prpl_init(account_t *acc)
49{
50        set_t *s;
51
52        s = set_add(&acc->set, "server", NULL, set_eval_account, acc);
53        s->flags |= SET_NOSAVE | ACC_SET_OFFLINE_ONLY | SET_NULL_OK;
54}
55
56/* Needed to silence warnings about named groupchats not supported */
57struct groupchat *unknown_prpl_chat_join(struct im_connection *ic, const char *room, const char *nick, const char *password,
58                                         set_t **sets)
59{
60        return NULL;
61}
62
63void unknown_prpl_initmodule(struct prpl **prpl)
64{
65        struct prpl *ret = g_new0(struct prpl, 1);
66
67        ret->name = "unknown";
68        ret->options = PRPL_OPT_UNKNOWN_PROTOCOL | PRPL_OPT_NOOTR;
69        ret->login = unknown_prpl_login;
70        ret->logout = unknown_prpl_logout;
71        ret->init = unknown_prpl_init;
72        ret->chat_join = unknown_prpl_chat_join;
73        *prpl = ret;
74}
75
Note: See TracBrowser for help on using the repository browser.