| 595 char *escaped; |
595 char *escaped; |
| 596 |
596 |
| 597 if (!args || !args[0]) |
597 if (!args || !args[0]) |
| 598 return; |
598 return; |
| 599 |
599 |
| 600 if (!irc->motd) |
|
| 601 irc->motd = g_string_new(""); |
|
| 602 |
|
| 603 if (!strcmp(name, "375")) { |
600 if (!strcmp(name, "375")) { |
| 604 if (irc->motd) |
601 if (irc->motd) |
| 605 g_string_free(irc->motd, TRUE); |
602 g_string_free(irc->motd, TRUE); |
| 606 irc->motd = g_string_new(""); |
603 irc->motd = g_string_new(""); |
| 607 return; |
604 return; |
| 608 } else if (!strcmp(name, "376")) { |
605 } else if (!strcmp(name, "376")) { |
| 609 /* dircproxy 1.0.5 does not send 251 on reconnection, so |
606 /* dircproxy 1.0.5 does not send 251 on reconnection, so |
| 610 * finalize the connection here if it is not already done. */ |
607 * finalize the connection here if it is not already done. */ |
| |
608 irc_connected(irc, args[0]); |
| |
609 return; |
| |
610 } else if (!strcmp(name, "422")) { |
| |
611 /* in case there is no 251, and no MOTD set, finalize the connection. |
| |
612 * (and clear the motd for good measure). */ |
| |
613 |
| |
614 if (irc->motd) |
| |
615 g_string_free(irc->motd, TRUE); |
| |
616 |
| 611 irc_connected(irc, args[0]); |
617 irc_connected(irc, args[0]); |
| 612 return; |
618 return; |
| 613 } |
619 } |
| 614 |
620 |
| 615 if (!irc->motd) { |
621 if (!irc->motd) { |