comparison src/server.c @ 1768:9aae465eeb6e

[gaim-migrate @ 1778] Start of the queueing stuff committer: Tailor Script <tailor@pidgin.im>
author Rob Flynn <gaim@robflynn.com>
date Sat, 28 Apr 2001 02:01:28 +0000
parents 1e0613d9526b
children 68eddf56f419
comparison
equal deleted inserted replaced
1767:5461acb8940a 1768:9aae465eeb6e
307 if (g->prpl && g->prpl->chat_send) 307 if (g->prpl && g->prpl->chat_send)
308 (*g->prpl->chat_send)(g, id, message); 308 (*g->prpl->chat_send)(g, id, message);
309 serv_touch_idle(g); 309 serv_touch_idle(g);
310 } 310 }
311 311
312
313
314 void serv_got_im(struct gaim_connection *gc, char *name, char *message, int away, time_t mtime) 312 void serv_got_im(struct gaim_connection *gc, char *name, char *message, int away, time_t mtime)
315 { 313 {
316 struct conversation *cnv; 314 struct conversation *cnv;
317 int new_conv = 0; 315 int new_conv = 0;
316 int hehe = away;
318 317
319 char *buffy = g_strdup(message); 318 char *buffy = g_strdup(message);
320 char *angel = g_strdup(name); 319 char *angel = g_strdup(name);
321 int plugin_return = plugin_event(event_im_recv, gc, &angel, &buffy, 0); 320 int plugin_return = plugin_event(event_im_recv, gc, &angel, &buffy, 0);
322 321
366 } 365 }
367 } else { 366 } else {
368 return; 367 return;
369 } 368 }
370 if (cnv != NULL) { 369 if (cnv != NULL) {
370
371 if (cnv->makesound && (sound_options & OPT_SOUND_RECV)) 371 if (cnv->makesound && (sound_options & OPT_SOUND_RECV))
372 play_sound(RECEIVE); 372 play_sound(RECEIVE);
373
374 if (gc->away)
375 {
376 struct queued_message *qm;
377
378 qm = (struct queued_message *)g_new0(struct queued_message, 1);
379 snprintf(qm->name, sizeof(qm->name), "%s", name);
380 qm->message = strdup(message);
381 qm->gc = gc;
382 qm->tm = mtime;
383
384 message_queue = g_slist_append(message_queue, qm);
385
386 printf("A message has been queued.\n");
387 }
388
373 write_to_conv(cnv, message, away | WFLAG_RECV, NULL, mtime); 389 write_to_conv(cnv, message, away | WFLAG_RECV, NULL, mtime);
390
374 } 391 }
375 392
376 } else { 393 } else {
377 if (cnv == NULL) { 394 if (cnv == NULL) {
378 new_conv = 1; 395 new_conv = 1;
386 play_sound(FIRST_RECEIVE); 403 play_sound(FIRST_RECEIVE);
387 } else { 404 } else {
388 if (cnv->makesound && (sound_options & OPT_SOUND_RECV)) 405 if (cnv->makesound && (sound_options & OPT_SOUND_RECV))
389 play_sound(RECEIVE); 406 play_sound(RECEIVE);
390 } 407 }
408
409 if (gc->away)
410 {
411 struct queued_message *qm;
412
413 qm = (struct queued_message *)g_new0(struct queued_message, 1);
414 snprintf(qm->name, sizeof(qm->name), "%s", name);
415 qm->message = strdup(message);
416 qm->gc = gc;
417 qm->tm = mtime;
418
419 message_queue = g_slist_append(message_queue, qm);
420
421 printf("A message has been queued.\n");
422 }
423
391 write_to_conv(cnv, message, away | WFLAG_RECV, NULL, mtime); 424 write_to_conv(cnv, message, away | WFLAG_RECV, NULL, mtime);
392 } 425 }
393 426
394 427
395 428