comparison src/server.c @ 1404:96e93119268d

[gaim-migrate @ 1414] argh committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Sat, 13 Jan 2001 08:49:15 +0000
parents bf041349b11e
children b37ed5eb0317
comparison
equal deleted inserted replaced
1403:c0aa7fdc0a93 1404:96e93119268d
158 } 158 }
159 159
160 160
161 void serv_set_away(struct gaim_connection *gc, char *state, char *message) 161 void serv_set_away(struct gaim_connection *gc, char *state, char *message)
162 { 162 {
163 if (gc && gc->prpl && gc->prpl->set_away) 163 if (gc && gc->prpl && gc->prpl->set_away) {
164 (*gc->prpl->set_away)(gc, state, message); 164 (*gc->prpl->set_away)(gc, state, message);
165 plugin_event(event_away, gc, state, message, 0);
166 }
165 } 167 }
166 168
167 void serv_set_away_all(char *message) 169 void serv_set_away_all(char *message)
168 { 170 {
169 GSList *c = connections; 171 GSList *c = connections;
170 struct gaim_connection *g; 172 struct gaim_connection *g;
171 173
172 while (c) { 174 while (c) {
173 g = (struct gaim_connection *)c->data; 175 g = (struct gaim_connection *)c->data;
174 if (g->prpl && g->prpl->set_away) 176 if (g->prpl && g->prpl->set_away) {
175 (*g->prpl->set_away)(g, GAIM_AWAY_CUSTOM, message); 177 (*g->prpl->set_away)(g, GAIM_AWAY_CUSTOM, message);
178 plugin_event(event_away, g, GAIM_AWAY_CUSTOM, message, 0);
179 }
176 c = c->next; 180 c = c->next;
177 } 181 }
178 } 182 }
179 183
180 void serv_set_info(struct gaim_connection *g, char *info) 184 void serv_set_info(struct gaim_connection *g, char *info)
346 } 350 }
347 351
348 if (away) 352 if (away)
349 away = WFLAG_AUTO; 353 away = WFLAG_AUTO;
350 354
351 if (awaymessage != NULL) { 355 if (gc->away) {
352 if (!(general_options & OPT_GEN_DISCARD_WHEN_AWAY)) { 356 if (!(general_options & OPT_GEN_DISCARD_WHEN_AWAY)) {
353 if (cnv == NULL) { 357 if (cnv == NULL) {
354 new_conv = 1; 358 new_conv = 1;
355 cnv = new_conversation(name); 359 cnv = new_conversation(name);
356 cnv->gc = gc; 360 cnv->gc = gc;
385 } 389 }
386 390
387 391
388 392
389 393
390 if (awaymessage != NULL) { 394 if (gc->away) {
391 time_t t; 395 time_t t;
392 char *tmpmsg; 396 char *tmpmsg;
393 struct buddy *b = find_buddy(gc, name); 397 struct buddy *b = find_buddy(gc, name);
394 char *alias = b ? b->show : name; 398 char *alias = b ? b->show : name;
395 399
400 return; 404 return;
401 405
402 cnv->sent_away = t; 406 cnv->sent_away = t;
403 407
404 /* apply default fonts and colors */ 408 /* apply default fonts and colors */
405 tmpmsg = stylize(awaymessage->message, MSG_LEN); 409 tmpmsg = stylize(gc->away, MSG_LEN);
406 410
407 serv_send_im(gc, name, away_subs(tmpmsg, alias), 1); 411 serv_send_im(gc, name, away_subs(tmpmsg, alias), 1);
408 412
409 if (cnv != NULL) 413 if (cnv != NULL)
410 write_to_conv(cnv, away_subs(tmpmsg, alias), WFLAG_SEND | WFLAG_AUTO, NULL); 414 write_to_conv(cnv, away_subs(tmpmsg, alias), WFLAG_SEND | WFLAG_AUTO, NULL);