Mercurial > pidgin
comparison src/protocols/oscar/family_chat.c @ 13254:e9802db22b06
[gaim-migrate @ 15620]
This is the way we clean the code, clean the code, clean the code
This is the way we clean the code, clean the code, clean the code
So early in the morning
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Sun, 12 Feb 2006 22:14:38 +0000 |
parents | 87a7c3077c19 |
children | b08f8f3c9197 |
comparison
equal
deleted
inserted
replaced
13253:87a7c3077c19 | 13254:e9802db22b06 |
---|---|
61 } | 61 } |
62 | 62 |
63 /* XXX get this into conn.c -- evil!! */ | 63 /* XXX get this into conn.c -- evil!! */ |
64 faim_export OscarConnection *aim_chat_getconn(OscarSession *sess, const char *name) | 64 faim_export OscarConnection *aim_chat_getconn(OscarSession *sess, const char *name) |
65 { | 65 { |
66 OscarConnection *cur; | 66 GList *cur; |
67 | 67 |
68 for (cur = sess->connlist; cur; cur = cur->next) { | 68 for (cur = sess->oscar_connections; cur; cur = cur->next) |
69 struct chatconnpriv *ccp = (struct chatconnpriv *)cur->internal; | 69 { |
70 | 70 OscarConnection *conn; |
71 if (cur->type != AIM_CONN_TYPE_CHAT) | 71 struct chatconnpriv *ccp; |
72 | |
73 conn = cur->data; | |
74 ccp = (struct chatconnpriv *)conn->internal; | |
75 | |
76 if (conn->type != AIM_CONN_TYPE_CHAT) | |
72 continue; | 77 continue; |
73 if (!cur->internal) { | 78 if (!conn->internal) { |
74 gaim_debug_misc("oscar", "faim: chat: chat connection with no name! (fd = %d)\n", cur->fd); | 79 gaim_debug_misc("oscar", "faim: chat: chat connection with no name! (fd = %d)\n", conn->fd); |
75 continue; | 80 continue; |
76 } | 81 } |
77 | 82 |
78 if (strcmp(ccp->name, name) == 0) | 83 if (strcmp(ccp->name, name) == 0) |
79 break; | 84 return conn;; |
80 } | 85 } |
81 | 86 |
82 return cur; | 87 return NULL; |
83 } | 88 } |
84 | 89 |
85 faim_export int aim_chat_attachname(OscarConnection *conn, guint16 exchange, const char *roomname, guint16 instance) | 90 faim_export int aim_chat_attachname(OscarConnection *conn, guint16 exchange, const char *roomname, guint16 instance) |
86 { | 91 { |
87 struct chatconnpriv *ccp; | 92 struct chatconnpriv *ccp; |
124 OscarConnection *conn; | 129 OscarConnection *conn; |
125 | 130 |
126 if (!(conn = aim_chat_getconn(sess, name))) | 131 if (!(conn = aim_chat_getconn(sess, name))) |
127 return -ENOENT; | 132 return -ENOENT; |
128 | 133 |
129 aim_conn_close(conn); | 134 aim_conn_close(sess, conn); |
130 | 135 |
131 return 0; | 136 return 0; |
132 } | 137 } |
133 | 138 |
134 /* | 139 /* |