]> jfr.im git - irc/xchat.git/commitdiff
* 1931579 workaround for python.
authorzed <redacted>
Sun, 25 May 2008 05:36:25 +0000 (05:36 +0000)
committerzed <redacted>
Sun, 25 May 2008 05:36:25 +0000 (05:36 +0000)
1970157 fix /clear
* make /ignore <nick> auto-add !*@* if found in userlist.
* show "Server load is temporarily too heavy" in msgbox if chanlist open.

git-svn-id: svn://svn.code.sf.net/p/xchat/svn@1297 893a96be-7f27-4fdf-9d1e-6aeec9d3cce1

src/common/outbound.c
src/common/proto-irc.c

index ec945254b7b52d0e147645cd7eda82a7173d9c63..44b84446fc29beaf9f31f17c514aa7f8f3c12431 100644 (file)
@@ -616,7 +616,6 @@ cmd_clear (struct session *sess, char *tbuf, char *word[], char *word_eol[])
 {
        GSList *list = sess_list;
        char *reason = word_eol[2];
-       int lines;
 
        if (strcasecmp (reason, "HISTORY") == 0)
        {
@@ -636,7 +635,7 @@ cmd_clear (struct session *sess, char *tbuf, char *word[], char *word_eol[])
                return TRUE;
        }
 
-       if (reason[0] != '-' && !isdigit (reason[0]))
+       if (reason[0] != '-' && !isdigit (reason[0]) && reason[0] != 0)
                return FALSE;
 
        fe_text_clear (sess, atoi (reason));
@@ -2210,6 +2209,7 @@ cmd_ignore (struct session *sess, char *tbuf, char *word[], char *word_eol[])
        int i;
        int type = 0;
        int quiet = 0;
+       char *mask;
 
        if (!*word[2])
        {
@@ -2226,17 +2226,26 @@ cmd_ignore (struct session *sess, char *tbuf, char *word[], char *word_eol[])
                {
                        if (type == 0)
                                return FALSE;
-                       i = ignore_add (word[2], type);
+
+                       mask = word[2];
+                       if (strchr (mask, '?') == NULL &&
+                           strchr (mask, '*') == NULL &&
+                           userlist_find (sess, mask))
+                       {
+                               mask = tbuf;
+                               snprintf (tbuf, TBUFSIZE, "%s!*@*", word[2]);
+                       }
+
+                       i = ignore_add (mask, type);
                        if (quiet)
                                return TRUE;
                        switch (i)
                        {
                        case 1:
-                               EMIT_SIGNAL (XP_TE_IGNOREADD, sess, word[2], NULL, NULL, NULL, 0);
+                               EMIT_SIGNAL (XP_TE_IGNOREADD, sess, mask, NULL, NULL, NULL, 0);
                                break;
                        case 2: /* old ignore changed */
-                               EMIT_SIGNAL (XP_TE_IGNORECHANGE, sess, word[2], NULL, NULL,
-                                                                NULL, 0);
+                               EMIT_SIGNAL (XP_TE_IGNORECHANGE, sess, mask, NULL, NULL, NULL, 0);
                        }
                        return TRUE;
                }
@@ -2706,7 +2715,7 @@ cmd_notify (struct session *sess, char *tbuf, char *word[], char *word_eol[])
                                return TRUE;
                        }
 
-                       if (strcmp (net, "ASK") == 0)
+                       if (net && strcmp (net, "ASK") == 0)
                                fe_notify_ask (word[i], NULL);
                        else
                        {
@@ -4058,8 +4067,8 @@ static void
 handle_say (session *sess, char *text, int check_spch)
 {
        struct DCC *dcc;
-       char *word[PDIWORDS];
-       char *word_eol[PDIWORDS];
+       char *word[PDIWORDS+1];
+       char *word_eol[PDIWORDS+1];
        char pdibuf_static[1024];
        char newcmd_static[1024];
        char *pdibuf = pdibuf_static;
@@ -4083,6 +4092,10 @@ handle_say (session *sess, char *text, int check_spch)
        if (check_spch && prefs.perc_color)
                check_special_chars (text, prefs.perc_ascii);
 
+       /* Python relies on this */
+       word[PDIWORDS] = NULL;
+       word_eol[PDIWORDS] = NULL;
+
        /* split the text into words and word_eol */
        process_data_init (pdibuf, text, word, word_eol, TRUE, FALSE);
 
index 316df64ecf01096713e17c811db76ce141d7450c..9f624a471933c56b276bbe0547f77039c31a2349 100644 (file)
@@ -488,7 +488,10 @@ process_numeric (session * sess, int n,
 
        case 263:       /*Server load is temporarily too heavy */
                if (fe_is_chanwindow (sess->server))
+               {
                        fe_chan_list_end (sess->server);
+                       fe_message (word_eol[5] + 1, FE_MSG_ERROR);
+               }
                goto def;
 
        case 290:       /* CAPAB reply */
@@ -1130,8 +1133,8 @@ irc_inline (server *serv, char *buf, int len)
 {
        session *sess, *tmp;
        char *type, *text;
-       char *word[PDIWORDS];
-       char *word_eol[PDIWORDS];
+       char *word[PDIWORDS+1];
+       char *word_eol[PDIWORDS+1];
        char pdibuf_static[522]; /* 1 line can potentially be 512*6 in utf8 */
        char *pdibuf = pdibuf_static;
 
@@ -1141,6 +1144,10 @@ irc_inline (server *serv, char *buf, int len)
 
        sess = serv->front_session;
 
+       /* Python relies on this */
+       word[PDIWORDS] = NULL;
+       word_eol[PDIWORDS] = NULL;
+
        if (buf[0] == ':')
        {
                /* split line into words and words_to_end_of_line */