Merged silc_1_0_branch to trunk.
[silc.git] / apps / irssi / src / fe-common / silc / fe-silc-queries.c
1 /*
2
3   fe-silc-queries.c
4
5   Author: Jochen Eisinger <c0ffee@penguin-breeder.org>
6
7   Copyright (C) 2003 Jochen Eisinger
8
9   This program is free software; you can redistribute it and/or modify
10   it under the terms of the GNU General Public License as published by
11   the Free Software Foundation; either version 2 of the License, or
12   (at your option) any later version.
13   
14   This program is distributed in the hope that it will be useful,
15   but WITHOUT ANY WARRANTY; without even the implied warranty of
16   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17   GNU General Public License for more details.
18
19 */
20
21 #include "module.h"
22 #include "modules.h"
23 #include "signals.h"
24 #include "themes.h"
25 #include "levels.h"
26 #include "misc.h"
27 #include "special-vars.h"
28 #include "settings.h"
29
30 #include "servers.h"
31 #include "channels.h"
32 #include "nicklist.h"
33 #include "ignore.h"
34
35 #include "window-items.h"
36 #include "fe-queries.h"
37 #include "fe-messages.h"
38 #include "hilight-text.h"
39 #include "printtext.h"
40 #include "module-formats.h"
41
42 static void sig_signed_message_query(SERVER_REC *server, const char *msg,
43                                 const char *nick, const char *address,
44                                 int verified)
45 {
46         QUERY_REC *query;
47
48         /* create query window if needed */
49         query = privmsg_get_query(server, nick, FALSE, MSGLEVEL_MSGS);
50
51         /* reset the query's last_unread_msg timestamp */
52         if (query != NULL)
53                 query->last_unread_msg = time(NULL);
54 }
55
56 void fe_silc_queries_init(void)
57 {
58   signal_add_first("message signed_private",
59                    (SIGNAL_FUNC) sig_signed_message_query);
60 }
61
62 void fe_silc_queries_deinit(void)
63 {
64   signal_remove("message signed_private",
65                 (SIGNAL_FUNC) sig_signed_message_query);
66 }