~ubuntu-branches/ubuntu/oneiric/irssi/oneiric

« back to all changes in this revision

Viewing changes to src/irc/core/irc.c

  • Committer: Bazaar Package Importer
  • Author(s): Emilio Pozuelo Monfort
  • Date: 2007-11-02 18:13:28 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20071102181328-vg4v2tuqeviu16g9
Tags: 0.8.12-2ubuntu1
* Merge with Debian, remaining Ubuntu changes:
  - Added debian/patches/90irc-ubuntu-com.dpatch (Launchpad #52690).
  - Modify Maintainer value to match the DebianMaintainerField spec.
  - debian/irssi.prerm: Do not alternative. LP: #67698.

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
14
    GNU General Public License for more details.
15
15
 
16
 
    You should have received a copy of the GNU General Public License
17
 
    along with this program; if not, write to the Free Software
18
 
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
16
    You should have received a copy of the GNU General Public License along
 
17
    with this program; if not, write to the Free Software Foundation, Inc.,
 
18
    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
19
*/
20
20
 
21
21
#include "module.h"
29
29
#include "irc-servers.h"
30
30
#include "irc-channels.h"
31
31
#include "servers-redirect.h"
 
32
#include "recode.h"
32
33
 
33
34
char *current_server_event;
34
35
static int signal_default_event;
281
282
{
282
283
        const char *signal;
283
284
        char *event, *args;
 
285
        char *params, *target, *recoded_line, *recoded_nick;
284
286
 
285
287
        g_return_if_fail(line != NULL);
286
288
 
 
289
        params = event_get_params(line, 2, NULL, &args);
 
290
        recoded_nick = recode_in(SERVER(server), nick, NULL);
 
291
        if (ischannel(*args) ||
 
292
            (*args++ == '@' && ischannel(*args)))
 
293
                target = args;
 
294
        else {
 
295
                target = recoded_nick;
 
296
        }
 
297
        recoded_line = recode_in(SERVER(server), line, target);
287
298
        /* split event / args */
288
 
        event = g_strconcat("event ", line, NULL);
 
299
        event = g_strconcat("event ", recoded_line, NULL);
289
300
        args = strchr(event+6, ' ');
290
301
        if (args != NULL) *args++ = '\0'; else args = "";
291
302
        while (*args == ' ') args++;
300
311
 
301
312
        /* emit it */
302
313
        current_server_event = event+6;
303
 
        if (!signal_emit(signal, 4, server, args, nick, address))
304
 
                signal_emit_id(signal_default_event, 4, server, line, nick, address);
 
314
        if (!signal_emit(signal, 4, server, args, recoded_nick, address))
 
315
                signal_emit_id(signal_default_event, 4, server, recoded_line, recoded_nick, address);
305
316
        current_server_event = NULL;
306
317
 
307
318
        g_free(event);
 
319
        g_free(params);
 
320
        g_free(recoded_line);
 
321
        g_free(recoded_nick);
308
322
}
309
323
 
310
324
/* Read line from server */