- Timestamp:
- 10/01/07 03:22:42 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ithildin-1.1/modules/ircd/protocols/shared/rfc1459_io.c
r717 r813 99 99 #ifdef RFC1459_SEND_MSG_LONG 100 100 if (from->client != NULL) 101 sm.len = sprintf(buf, ":%s!%s@%s %s %s%s", from->client->nick, 102 from->client->user, from->client->host, cmd, 103 (to != NULL ? to : ""), (to != NULL ? " " : "")); 101 sm.len = sprintf(buf, ":%s!%s@%s %s", from->client->nick, 102 from->client->user, from->client->host, cmd); 104 103 #else 105 104 if (from->client != NULL) 106 sm.len = sprintf(buf, ":%s %s %s%s", from->client->nick, cmd, 107 (to != NULL ? to : ""), (to != NULL ? " " : "")); 105 sm.len = sprintf(buf, ":%s %s", from->client->nick, cmd); 108 106 #endif 109 107 else if (from->server != NULL) 110 sm.len = sprintf(buf, ":%s %s %s%s", from->server->name, cmd, 111 (to != NULL ? to : ""), (to != NULL ? " " : "")); 108 sm.len = sprintf(buf, ":%s %s", from->server->name, cmd); 112 109 else 113 sm.len = sprintf(buf, "%s %s%s", cmd, 114 (to != NULL ? to : ""), (to != NULL ? " " : "")); 115 if (msg != NULL) 110 sm.len = sprintf(buf, "%s", cmd); 111 112 /* If to is provided we format the message in a special way to work 113 * around some clients incorrect assumptions about the way the server 114 * is required to send messages. Specifially the gaim/pidgin developers 115 * refuse to fix a bug in their parser related to handling the JOIN 116 * command properly when the last argument is not prefixed with a : (not 117 * required). */ 118 if (to != NULL) { 119 if (msg == NULL) 120 sm.len += sprintf(buf + sm.len, " :%s", to); 121 else 122 sm.len += sprintf(buf + sm.len, " %s ", to); 123 } 124 125 if (msg != NULL) { 126 if (to == NULL) 127 /* we need an extra space because of the above.. */ 128 buf[sm.len++] = ' '; 129 116 130 sm.len += vsnprintf(&buf[sm.len], MAX_PACKET_LEN - 3 - sm.len, msg, 117 131 args); 132 } 118 133 119 134 /* XXX: GREAT POTENTIAL FOR EVIL. Someone running their server in
Note: See TracChangeset
for help on using the changeset viewer.
