Changeset 537d9b9 for irc_send.c
- Timestamp:
- 2016-11-20T08:40:36Z (8 years ago)
- Children:
- 3f44e43
- Parents:
- ba52ac5 (diff), 9f03c47 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
irc_send.c
rba52ac5 r537d9b9 41 41 { 42 42 irc_send_num(irc, 1, ":Welcome to the %s gateway, %s", PACKAGE, irc->user->nick); 43 irc_send_num(irc, 2, ":Host %s is running %s %s %s/%s.", irc->root->host,44 PACKAGE, BITLBEE_VERSION , ARCH, CPU);43 irc_send_num(irc, 2, ":Host %s is running %s %s.", irc->root->host, 44 PACKAGE, BITLBEE_VERSION); 45 45 irc_send_num(irc, 3, ":%s", IRCD_INFO); 46 46 irc_send_num(irc, 4, "%s %s %s %s", irc->root->host, BITLBEE_VERSION, UMODES UMODES_PRIV, CMODES); … … 54 54 void irc_send_motd(irc_t *irc) 55 55 { 56 char motd[2048];57 s size_t len;58 int fd; 59 60 fd = open(global.conf->motdfile, O_RDONLY); 61 if ( fd == -1 || (len = read(fd, motd, sizeof(motd) - 1)) <= 0) {56 char *motd; 57 size_t len; 58 59 g_file_get_contents(global.conf->motdfile, &motd, &len, NULL); 60 61 if (!motd || !len) { 62 62 irc_send_num(irc, 422, ":We don't need MOTDs."); 63 63 } else { … … 66 66 67 67 in = motd; 68 motd[len] = '\0';69 68 linebuf[79] = len = 0; 70 69 max = sizeof(linebuf) - 1; … … 101 100 } 102 101 103 if (fd != -1) { 104 close(fd); 105 } 102 g_free(motd); 103 106 104 } 107 105 … … 348 346 } 349 347 350 /* rfc1459 doesn't mention this: G means gone, H means here */ 351 status_prefix[0] = iu->flags & IRC_USER_AWAY ? 'G' : 'H'; 348 /* If this is the account nick, check configuration to see if away */ 349 if (iu == irc->user) { 350 /* rfc1459 doesn't mention this: G means gone, H means here */ 351 status_prefix[0] = set_getstr(&irc->b->set, "away") ? 'G' : 'H'; 352 } else { 353 status_prefix[0] = iu->flags & IRC_USER_AWAY ? 'G' : 'H'; 354 } 352 355 353 356 irc_send_num(irc, 352, "%s %s %s %s %s %s :0 %s",
Note: See TracChangeset
for help on using the changeset viewer.