Debian Codegraph @

src/fe-common/fe-xmpp-windows.c

raw symbols SCIP
1 /*
2 * Copyright (C) 2007,2008,2009 Colin DIDIER
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
16 */
17
18 #include "module.h"
19 #include "channels.h"
20 #include "signals.h"
21 #include "window-items.h"
22
23 #include "xmpp-servers.h"
24
25 /*
26 * Hack to get the name of the current XMPP channel which is necessary
27 * to open a query with a nick in the channel
28 * (because its jid is like: channel@host/nick)
29 */
30
31 static void
32 sig_get_active_channel(const char **name)
33 {
34 *name = IS_XMPP_SERVER(active_win->active_server)
35 && IS_CHANNEL(active_win->active) ?
36 ((CHANNEL_REC *)active_win->active)->name : NULL;
37 }
38
39 void
40 fe_xmpp_windows_init(void)
41 {
42 signal_add("xmpp windows get active channel", sig_get_active_channel);
43 }
44
45 void
46 fe_xmpp_windows_deinit(void)
47 {
48 signal_remove("xmpp windows get active channel",
49 sig_get_active_channel);
50 }