Mercurial > pidgin
comparison src/protocols/toc/toc.c @ 2167:edf8c5a70e5b
[gaim-migrate @ 2177]
limiting chat message lengths
committer: Tailor Script <tailor@pidgin.im>
| author | Eric Warmenhoven <eric@warmenhoven.org> |
|---|---|
| date | Sun, 26 Aug 2001 20:21:45 +0000 |
| parents | a464da684307 |
| children | c24595d3c364 |
comparison
equal
deleted
inserted
replaced
| 2166:dbd74f49dabb | 2167:edf8c5a70e5b |
|---|---|
| 943 char buf2[BUF_LEN * 2]; | 943 char buf2[BUF_LEN * 2]; |
| 944 g_snprintf(buf2, sizeof(buf2), "toc_chat_whisper %d %s \"%s\"", id, who, message); | 944 g_snprintf(buf2, sizeof(buf2), "toc_chat_whisper %d %s \"%s\"", id, who, message); |
| 945 sflap_send(g, buf2, -1, TYPE_DATA); | 945 sflap_send(g, buf2, -1, TYPE_DATA); |
| 946 } | 946 } |
| 947 | 947 |
| 948 static void toc_chat_send(struct gaim_connection *g, int id, char *message) | 948 static int toc_chat_send(struct gaim_connection *g, int id, char *message) |
| 949 { | 949 { |
| 950 char buf[BUF_LEN * 2]; | 950 char buf[BUF_LEN * 2]; |
| 951 escape_text(message); | 951 escape_text(message); |
| 952 if (strlen(message) > 2000) | |
| 953 return -E2BIG; | |
| 952 g_snprintf(buf, sizeof(buf), "toc_chat_send %d \"%s\"", id, message); | 954 g_snprintf(buf, sizeof(buf), "toc_chat_send %d \"%s\"", id, message); |
| 953 sflap_send(g, buf, -1, TYPE_DATA); | 955 sflap_send(g, buf, -1, TYPE_DATA); |
| 956 return 0; | |
| 954 } | 957 } |
| 955 | 958 |
| 956 static void toc_keepalive(struct gaim_connection *gc) | 959 static void toc_keepalive(struct gaim_connection *gc) |
| 957 { | 960 { |
| 958 sflap_send(gc, "", 0, TYPE_KEEPALIVE); | 961 sflap_send(gc, "", 0, TYPE_KEEPALIVE); |
