~ubuntu-branches/ubuntu/jaunty/irssi-plugin-xmpp/jaunty

« back to all changes in this revision

Viewing changes to src/fe-common/fe-xmpp-messages.c

  • Committer: Bazaar Package Importer
  • Author(s): David Ammouial
  • Date: 2008-06-23 16:03:33 UTC
  • mfrom: (1.1.2 upstream) (2.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080623160333-3wwbzgtzwznjjvrf
Tags: 0.13+cvs20080610-1
* New CVS snapshot:
  - New features and bugfixes.
  - Fix ignoring of messages without a type attribute (Closes: #477989).
* Depend on irssi >=0.8.12 (Closes: #469923).
* Add FAQ and MUC to documentation files (Closes: #485595).
* debian/rules: install help files in irssi help directory.
* debian/rules: Remove useless "make -n" command in build-stamp rule.
* Bump Standards-Version to 3.8.0 (no changes needed). 
* debian/control: Add "Enhances: irssi".

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * $Id: fe-xmpp-messages.c,v 1.13 2007/12/29 18:54:08 errtu Exp $
 
2
 * $Id: fe-xmpp-messages.c,v 1.17 2008/03/01 17:57:21 errtu Exp $
3
3
 *
4
4
 * Copyright (C) 2007 Colin DIDIER
5
5
 *
6
6
 * This program is free software; you can redistribute it and/or modify
7
 
 * it under the terms of the GNU General Public License as published by
8
 
 * the Free Software Foundation; either version 2 of the License, or
9
 
 * (at your option) any later version.
 
7
 * it under the terms of the GNU General Public License version 2 as
 
8
 * published by the Free Software Foundation.
10
9
 *
11
10
 * This program is distributed in the hope that it will be useful,
12
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
80
79
                    != NULL)
81
80
                        print_channel = TRUE;
82
81
 
83
 
                /* in versions of irssi prior to 0.8.12 (20071006), channel_get_nickmode
84
 
                 * doesn't return a dynamically allocated string */
 
82
                /* in versions of irssi prior to 0.8.12 (20071006),
 
83
                 * channel_get_nickmode() doesn't return a dynamically
 
84
                 * allocated string */
85
85
#if IRSSI_VERSION_DATE >= 20071006
86
86
                nickmode = channel_get_nickmode(chanrec, nick);
87
87
#else
344
344
        signal_stop();
345
345
}
346
346
 
 
347
static void
 
348
sig_message_ignore(XMPP_SERVER_REC *server)
 
349
{
 
350
        if (IS_XMPP_SERVER(server))
 
351
                signal_stop();
 
352
}
 
353
 
347
354
void
348
355
fe_xmpp_messages_init(void)
349
356
{
353
360
        signal_add("message xmpp action", (SIGNAL_FUNC)sig_action);
354
361
        signal_add("message xmpp own_action", (SIGNAL_FUNC)sig_own_action);
355
362
        signal_add("message xmpp error", (SIGNAL_FUNC)sig_error);
 
363
        signal_add_first("message xmpp own_public",
 
364
            (SIGNAL_FUNC)sig_message_own_public);
356
365
        signal_add_first("message own_public",
357
 
            (SIGNAL_FUNC)sig_message_own_public);
 
366
            (SIGNAL_FUNC)sig_message_ignore);
358
367
        signal_add_first("message own_private",
359
368
            (SIGNAL_FUNC)sig_message_own_private);
360
369
}
368
377
        signal_remove("message xmpp action", (SIGNAL_FUNC)sig_action);
369
378
        signal_remove("message xmpp own_action", (SIGNAL_FUNC)sig_own_action);
370
379
        signal_remove("message xmpp error", (SIGNAL_FUNC)sig_error);
 
380
        signal_remove("message xmpp own_public",
 
381
            (SIGNAL_FUNC)sig_message_own_public);
371
382
        signal_remove("message own_public",
372
 
            (SIGNAL_FUNC)sig_message_own_public);
 
383
            (SIGNAL_FUNC)sig_message_ignore);
373
384
        signal_remove("message own_private",
374
385
            (SIGNAL_FUNC)sig_message_own_private);
375
386
}