Beispiel #1
0
//  evs_display_list()
// Prints list of events to mcabber log window.
void evs_display_list(void)
{
  guint count = 0;
  GSList *p;

  scr_LogPrint(LPRINT_NORMAL, "Events list:");
  for (p = evs_list; p; p = g_slist_next(p)) {
    evs_t *i = p->data;
    scr_LogPrint(LPRINT_NORMAL,
                 "Id: %-3s %s", i->id,
                 (i->description ? i->description : ""));
    count++;
  }
  scr_LogPrint(LPRINT_NORMAL, "End of events list.");
  if (count+2 > scr_getlogwinheight()) {
    scr_setmsgflag_if_needed(SPECIAL_BUFFER_STATUS_ID, TRUE);
    scr_setattentionflag_if_needed(SPECIAL_BUFFER_STATUS_ID, TRUE,
                                   ROSTER_UI_PRIO_STATUS_WIN_MESSAGE, prio_max);
  }
}
Beispiel #2
0
static guint highlight_process_message(const gchar *hook, hk_arg_t *args, gpointer data) {
    const gchar *jid, *resource, *message;
    gboolean groupchat, delayed, errored;
    GSList *item = NULL;

    /* If we don't have any matches, abort early. */
    if (globals.match_list == NULL)
        goto finished;

    /* See +247 dd8ae0abfc68:tip:mcabber/hooks.c */
    jid       = args[0].value;
    resource  = args[1].value;
    message   = args[2].value;

    delayed   = (strlen(args[4].value) > 0);
    errored   = (strcmp(args[5].value, "true") == 0);
    groupchat = (strcmp(args[3].value, "true") == 0);

    /* We don't want to process either delayed or error messages. */
    if (delayed || errored)
        goto finished;

    /* Iterate through our list of regexps and see if they match this message. */
    for (item = globals.match_list; item; item = g_slist_next(item)) {
        GRegex *regex = (GRegex *) item->data;

        if (g_regex_match(regex, message, 0, NULL)) {
            /* Set the attention flag if necessary. */
            scr_setattentionflag_if_needed(jid, FALSE, ROSTER_UI_PRIO_ATTENTION_MESSAGE, prio_max);
            break;
        }
    }

finished:
    /* Always continue processing messages. */
    return HOOK_HANDLER_RESULT_ALLOW_MORE_HANDLERS;
}