Mercurial > pidgin
comparison src/protocols/toc/toc.c @ 4111:ee884f1d7ae3
[gaim-migrate @ 4326]
<Robot101> adds a gc->flag called OPT_CONN_AUTO_RESP so that
gc->away can always store the away message even if
the prpl doesn't support autoresponding
<Robot101> makes all protos correctly free and set gc->away to
avoid leaks
<Robot101> stores the current away state in gc->away_state
whenever gc->away is non-NULL (ie it's not just a
plain on-line)
<Robot101> also minor change to Jabber to make Chatty an away
state, and to Gadu-Gadu to make some other thing an
away state too
committer: Tailor Script <tailor@pidgin.im>
| author | Christian Hammond <chipx86@chipx86.com> |
|---|---|
| date | Sat, 21 Dec 2002 19:33:54 +0000 |
| parents | 43e396e94095 |
| children | 474265997752 |
comparison
equal
deleted
inserted
replaced
| 4110:64d983d6b7bb | 4111:ee884f1d7ae3 |
|---|---|
| 187 char buf[80]; | 187 char buf[80]; |
| 188 | 188 |
| 189 gc = new_gaim_conn(user); | 189 gc = new_gaim_conn(user); |
| 190 gc->proto_data = tdt = g_new0(struct toc_data, 1); | 190 gc->proto_data = tdt = g_new0(struct toc_data, 1); |
| 191 gc->flags |= OPT_CONN_HTML; | 191 gc->flags |= OPT_CONN_HTML; |
| 192 gc->flags |= OPT_CONN_AUTO_RESP; | |
| 192 | 193 |
| 193 g_snprintf(buf, sizeof buf, "Looking up %s", | 194 g_snprintf(buf, sizeof buf, "Looking up %s", |
| 194 user->proto_opt[USEROPT_AUTH][0] ? user->proto_opt[USEROPT_AUTH] : TOC_HOST); | 195 user->proto_opt[USEROPT_AUTH][0] ? user->proto_opt[USEROPT_AUTH] : TOC_HOST); |
| 195 set_login_progress(gc, 1, buf); | 196 set_login_progress(gc, 1, buf); |
| 196 | 197 |
| 1035 } | 1036 } |
| 1036 | 1037 |
| 1037 static void toc_set_away(struct gaim_connection *g, char *state, char *message) | 1038 static void toc_set_away(struct gaim_connection *g, char *state, char *message) |
| 1038 { | 1039 { |
| 1039 char buf[BUF_LEN * 2]; | 1040 char buf[BUF_LEN * 2]; |
| 1040 if (g->away) | 1041 if (g->away) { |
| 1041 g_free (g->away); | 1042 g_free (g->away); |
| 1042 g->away = NULL; | 1043 g->away = NULL; |
| 1044 } | |
| 1043 if (message) { | 1045 if (message) { |
| 1044 char *tmp = g_malloc(strlen(message) * 4 + 1); | 1046 char *tmp = g_malloc(strlen(message) * 4 + 1); |
| 1045 strcpy(tmp, message); | 1047 strcpy(tmp, message); |
| 1046 g->away = g_strdup (message); | 1048 g->away = g_strdup (message); |
| 1047 escape_text(tmp); | 1049 escape_text(tmp); |
