comparison libfaim/aim_chat.c @ 338:9d258a0aa560

[gaim-migrate @ 348] Whoa, all kinds of things happened here. The applet looks better. The preferences dialog changes based on your compile-time options (oscar, gnome). Whispering works again. libfaim got updated; it can almost do RVOUS stuff, and hopefully soon can make requests too. The applet doesn't need to have its sounds go through GNOME, although it still can. There is code to facilitate SOCKS5 support (all that needs to be done is to actually write the code to communicate with the proxy server). committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Tue, 06 Jun 2000 09:55:30 +0000
parents 8cdc4ab449ec
children e4c34ca88d9b
comparison
equal deleted inserted replaced
337:f5b199e20d12 338:9d258a0aa560
17 return (char *)conn->priv; /* yuck ! */ 17 return (char *)conn->priv; /* yuck ! */
18 } 18 }
19 19
20 struct aim_conn_t *aim_chat_getconn(struct aim_session_t *sess, char *name) 20 struct aim_conn_t *aim_chat_getconn(struct aim_session_t *sess, char *name)
21 { 21 {
22 int i; 22 struct aim_conn_t *cur;
23 23
24 for (i=0;i<AIM_CONN_MAX;i++) 24 faim_mutex_lock(&sess->connlistlock);
25 { 25 for (cur = sess->connlist; cur; cur = cur->next) {
26 if (sess->conns[i].type == AIM_CONN_TYPE_CHAT) 26 if (cur->type != AIM_CONN_TYPE_CHAT)
27 { 27 continue;
28 if (sess->conns[i].priv) 28 if (strcmp((char *)cur->priv, name) == 0)
29 if (!strcmp((char *)sess->conns[i].priv, name)) 29 break;
30 { 30 }
31 return &sess->conns[i]; 31 faim_mutex_unlock(&sess->connlistlock);
32 } 32
33 } 33 return cur;
34 }
35 return NULL;
36 } 34 }
37 35
38 int aim_chat_attachname(struct aim_conn_t *conn, char *roomname) 36 int aim_chat_attachname(struct aim_conn_t *conn, char *roomname)
39 { 37 {
40 if (!conn || !roomname) 38 if (!conn || !roomname)
540 return (sess->snac_nextid++); 538 return (sess->snac_nextid++);
541 } 539 }
542 540
543 int aim_chat_leaveroom(struct aim_session_t *sess, char *name) 541 int aim_chat_leaveroom(struct aim_session_t *sess, char *name)
544 { 542 {
545 int i; 543 struct aim_conn_t *conn;
546 544
547 for (i=0;i<AIM_CONN_MAX;i++) 545 if ((conn = aim_chat_getconn(sess, name)))
548 { 546 aim_conn_kill(sess, &conn);
549 if (sess->conns[i].type == AIM_CONN_TYPE_CHAT) 547
550 { 548 if (!conn)
551 if (sess->conns[i].priv) 549 return -1;
552 if (!strcmp((char *)sess->conns[i].priv, name)) 550 return 0;
553 {
554 aim_conn_close(&sess->conns[i]);
555 return 0;
556 }
557 }
558 }
559 return -1;
560 } 551 }
561 552
562 /* 553 /*
563 * conn must be a BOS connection! 554 * conn must be a BOS connection!
564 */ 555 */