~ubuntu-branches/ubuntu/maverick/xchat/maverick

« back to all changes in this revision

Viewing changes to src/common/inbound.c

  • Committer: Bazaar Package Importer
  • Author(s): Lorenzo De Liso
  • Date: 2010-06-21 22:47:10 UTC
  • mfrom: (2.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20100621224710-9t1iyiglri330pss
Tags: 2.8.8-1ubuntu1
* Merge from debian unstable (LP: #597042), remaining changes:
  - debian/patches:
    + series: Refreshed.
    + 01_serverlist.patch: Numerous changes to default serverlist.
    + 02_ubuntu_default_server.patch: select "Ubuntu servers" by default.
    + 37_lpi.patch: Add launchpad integration.
    + 38_autoconf.patch: Autoconf modifications for launchpad integration.
    + 45_brand_ctcp_version.patch: Add Ubuntu brand to CTCP version response.
    + 70_notification_strings_shorten.patch: Shorten notification strings.
  - debian/control:
    + Build-depend on libgtk2.0-dev (>= 2.10.0).
    + Build-depend on liblaunchpad-integration-dev.
    + Remove conflict/replaces on xchat-gnome.
    + Updated Maintainer field to match Ubuntu Developers.
  - debian/rules:
    + Make build independent of the python version.
  - debian/patches/45_ctcp_version_less_information.dpatch: 
    + Renamed to debian/patches/45_brand_ctcp_version.patch
    + Added short description.
* Converted all patches to quilt, as in debian quilt has been
  adopted, all old dpatch patches have been renamed with the 
  *.patch extension.
* Dropped changes:
  - 71_notification_icon_change.patch: can't be applied

Show diffs side-by-side

added added

removed removed

Lines of Context:
307
307
}
308
308
 
309
309
void
310
 
inbound_action (session *sess, char *chan, char *from, char *text, int fromme, int id)
 
310
inbound_action (session *sess, char *chan, char *from, char *ip, char *text, int fromme, int id)
311
311
{
312
312
        session *def = sess;
313
313
        server *serv = sess->server;
314
314
        struct User *user;
315
315
        char nickchar[2] = "\000";
 
316
        char idtext[64];
 
317
        int privaction = FALSE;
316
318
 
317
319
        if (!fromme)
318
320
        {
322
324
                } else
323
325
                {
324
326
                        /* it's a private action! */
 
327
                        privaction = TRUE;
325
328
                        /* find a dialog tab for it */
326
329
                        sess = find_dialog (serv, from);
327
330
                        /* if non found, open a new one */
328
331
                        if (!sess && prefs.autodialog)
329
 
                                sess = inbound_open_dialog (serv, from);
 
332
                        {
 
333
                                /* but only if it wouldn't flood */
 
334
                                if (flood_check (from, ip, serv, current_sess, 1))
 
335
                                        sess = inbound_open_dialog (serv, from);
 
336
                                else
 
337
                                        sess = serv->server_session;
 
338
                        }
 
339
                        if (!sess)
 
340
                        {
 
341
                                sess = find_session_from_nick (from, serv);
 
342
                                /* still not good? */
 
343
                                if (!sess)
 
344
                                        sess = serv->front_session;
 
345
                        }
330
346
                }
331
347
        }
332
348
 
353
369
                user->lasttalk = time (0);
354
370
        }
355
371
 
356
 
        if (!fromme)
 
372
        inbound_make_idtext (serv, idtext, sizeof (idtext), id);
 
373
 
 
374
        if (!fromme && !privaction)
357
375
        {
358
376
                if (is_hilight (from, text, sess, serv))
359
377
                {
360
 
                        EMIT_SIGNAL (XP_TE_HCHANACTION, sess, from, text, nickchar, NULL, 0);
 
378
                        EMIT_SIGNAL (XP_TE_HCHANACTION, sess, from, text, nickchar, idtext, 0);
361
379
                        return;
362
380
                }
363
381
        }
364
382
 
365
383
        if (fromme)
366
 
                EMIT_SIGNAL (XP_TE_UACTION, sess, from, text, nickchar, NULL, 0);
 
384
                EMIT_SIGNAL (XP_TE_UACTION, sess, from, text, nickchar, idtext, 0);
 
385
        else if (!privaction)
 
386
                EMIT_SIGNAL (XP_TE_CHANACTION, sess, from, text, nickchar, idtext, 0);
 
387
        else if (sess->type == SESS_DIALOG)
 
388
                EMIT_SIGNAL (XP_TE_DPRIVACTION, sess, from, text, idtext, NULL, 0);
367
389
        else
368
 
                EMIT_SIGNAL (XP_TE_CHANACTION, sess, from, text, nickchar, NULL, 0);
 
390
                EMIT_SIGNAL (XP_TE_PRIVACTION, sess, from, text, idtext, NULL, 0);
369
391
}
370
392
 
371
393
void