comparison src/server.c @ 5676:dae79aefac8d

[gaim-migrate @ 6094] I've been meaning to do this for a LONG time. The conversation API now follows the naming convention of the rest of the new APIs. I'll get some g_return_*_if_fail() checks in there soon. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Mon, 02 Jun 2003 21:51:06 +0000
parents 4e2ffa3d9094
children 8e618a7111a5
comparison
equal deleted inserted replaced
5675:17e345ffeddb 5676:dae79aefac8d
97 { 97 {
98 GaimPlugin *prpl; 98 GaimPlugin *prpl;
99 GaimPluginProtocolInfo *prpl_info = NULL; 99 GaimPluginProtocolInfo *prpl_info = NULL;
100 100
101 while (gc->buddy_chats) { 101 while (gc->buddy_chats) {
102 struct gaim_conversation *b = gc->buddy_chats->data; 102 GaimConversation *b = gc->buddy_chats->data;
103 103
104 gc->buddy_chats = g_slist_remove(gc->buddy_chats, b); 104 gc->buddy_chats = g_slist_remove(gc->buddy_chats, b);
105 105
106 /* TODO: Nuke the UI-specific code here. */ 106 /* TODO: Nuke the UI-specific code here. */
107 if (GAIM_IS_GTK_CONVERSATION(b)) 107 if (GAIM_IS_GTK_CONVERSATION(b))
187 struct queued_away_response *find_queued_away_response_by_name(char *name); 187 struct queued_away_response *find_queued_away_response_by_name(char *name);
188 188
189 int serv_send_im(GaimConnection *gc, char *name, char *message, 189 int serv_send_im(GaimConnection *gc, char *name, char *message,
190 int len, int flags) 190 int len, int flags)
191 { 191 {
192 struct gaim_conversation *c; 192 GaimConversation *c;
193 int val = -EINVAL; 193 int val = -EINVAL;
194 GaimPluginProtocolInfo *prpl_info = NULL; 194 GaimPluginProtocolInfo *prpl_info = NULL;
195 195
196 if (gc != NULL && gc->prpl != NULL) 196 if (gc != NULL && gc->prpl != NULL)
197 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl); 197 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl);
755 char *buffy; 755 char *buffy;
756 char *angel; 756 char *angel;
757 int plugin_return; 757 int plugin_return;
758 int away = 0; 758 int away = 0;
759 759
760 struct gaim_conversation *cnv; 760 GaimConversation *cnv;
761 761
762 char *message, *name; 762 char *message, *name;
763 763
764 /* 764 /*
765 * Pay no attention to the man behind the curtain. 765 * Pay no attention to the man behind the curtain.
1085 gaim_blist_update_buddy_status(b, type); 1085 gaim_blist_update_buddy_status(b, type);
1086 1086
1087 1087
1088 if (loggedin) { 1088 if (loggedin) {
1089 if (!GAIM_BUDDY_IS_ONLINE(b)) { 1089 if (!GAIM_BUDDY_IS_ONLINE(b)) {
1090 struct gaim_conversation *c = gaim_find_conversation(b->name); 1090 GaimConversation *c = gaim_find_conversation(b->name);
1091 if (c != NULL && 1091 if (c != NULL &&
1092 gaim_prefs_get_bool("/core/conversations/im/show_login")) { 1092 gaim_prefs_get_bool("/core/conversations/im/show_login")) {
1093 1093
1094 char *tmp = g_strdup_printf(_("%s logged in."), 1094 char *tmp = g_strdup_printf(_("%s logged in."),
1095 gaim_get_buddy_alias(b)); 1095 gaim_get_buddy_alias(b));
1113 gaim_pounce_execute(gc->account, b->name, GAIM_POUNCE_SIGNON); 1113 gaim_pounce_execute(gc->account, b->name, GAIM_POUNCE_SIGNON);
1114 system_log(log_signon, gc, b, OPT_LOG_BUDDY_SIGNON); 1114 system_log(log_signon, gc, b, OPT_LOG_BUDDY_SIGNON);
1115 } 1115 }
1116 } else { 1116 } else {
1117 if (GAIM_BUDDY_IS_ONLINE(b)) { 1117 if (GAIM_BUDDY_IS_ONLINE(b)) {
1118 struct gaim_conversation *c = gaim_find_conversation(b->name); 1118 GaimConversation *c = gaim_find_conversation(b->name);
1119 if (c != NULL && 1119 if (c != NULL &&
1120 gaim_prefs_get_bool("/core/conversations/im/show_login")) { 1120 gaim_prefs_get_bool("/core/conversations/im/show_login")) {
1121 1121
1122 char *tmp = g_strdup_printf(_("%s logged out."), 1122 char *tmp = g_strdup_printf(_("%s logged out."),
1123 gaim_get_buddy_alias(b)); 1123 gaim_get_buddy_alias(b));
1171 1171
1172 void serv_got_typing(GaimConnection *gc, const char *name, int timeout, 1172 void serv_got_typing(GaimConnection *gc, const char *name, int timeout,
1173 int state) { 1173 int state) {
1174 1174
1175 struct buddy *b; 1175 struct buddy *b;
1176 struct gaim_conversation *cnv = gaim_find_conversation(name); 1176 GaimConversation *cnv = gaim_find_conversation(name);
1177 struct gaim_im *im; 1177 GaimIm *im;
1178 1178
1179 if (!cnv) 1179 if (!cnv)
1180 return; 1180 return;
1181 1181
1182 im = GAIM_IM(cnv); 1182 im = GAIM_IM(cnv);
1196 gaim_im_start_typing_timeout(im, timeout); 1196 gaim_im_start_typing_timeout(im, timeout);
1197 } 1197 }
1198 1198
1199 void serv_got_typing_stopped(GaimConnection *gc, const char *name) { 1199 void serv_got_typing_stopped(GaimConnection *gc, const char *name) {
1200 1200
1201 struct gaim_conversation *c = gaim_find_conversation(name); 1201 GaimConversation *c = gaim_find_conversation(name);
1202 struct gaim_im *im; 1202 GaimIm *im;
1203 struct buddy *b; 1203 struct buddy *b;
1204 1204
1205 if (!c) 1205 if (!c)
1206 return; 1206 return;
1207 1207
1268 buf2, 0, cid, 1268 buf2, 0, cid,
1269 G_CALLBACK(chat_invite_accept), 1269 G_CALLBACK(chat_invite_accept),
1270 G_CALLBACK(chat_invite_data_free)); 1270 G_CALLBACK(chat_invite_data_free));
1271 } 1271 }
1272 1272
1273 struct gaim_conversation *serv_got_joined_chat(GaimConnection *gc, 1273 GaimConversation *serv_got_joined_chat(GaimConnection *gc,
1274 int id, const char *name) 1274 int id, const char *name)
1275 { 1275 {
1276 struct gaim_conversation *b; 1276 GaimConversation *b;
1277 struct gaim_chat *chat; 1277 GaimChat *chat;
1278 1278
1279 b = gaim_conversation_new(GAIM_CONV_CHAT, gc->account, name); 1279 b = gaim_conversation_new(GAIM_CONV_CHAT, gc->account, name);
1280 chat = GAIM_CHAT(b); 1280 chat = GAIM_CHAT(b);
1281 1281
1282 gc->buddy_chats = g_slist_append(gc->buddy_chats, b); 1282 gc->buddy_chats = g_slist_append(gc->buddy_chats, b);
1318 } 1318 }
1319 1319
1320 void serv_got_chat_left(GaimConnection *g, int id) 1320 void serv_got_chat_left(GaimConnection *g, int id)
1321 { 1321 {
1322 GSList *bcs; 1322 GSList *bcs;
1323 struct gaim_conversation *conv = NULL; 1323 GaimConversation *conv = NULL;
1324 struct gaim_chat *chat = NULL; 1324 GaimChat *chat = NULL;
1325 1325
1326 for (bcs = g->buddy_chats; bcs != NULL; bcs = bcs->next) { 1326 for (bcs = g->buddy_chats; bcs != NULL; bcs = bcs->next) {
1327 conv = (struct gaim_conversation *)bcs->data; 1327 conv = (GaimConversation *)bcs->data;
1328 1328
1329 chat = GAIM_CHAT(conv); 1329 chat = GAIM_CHAT(conv);
1330 1330
1331 if (gaim_chat_get_id(chat) == id) 1331 if (gaim_chat_get_id(chat) == id)
1332 break; 1332 break;
1350 void serv_got_chat_in(GaimConnection *g, int id, char *who, 1350 void serv_got_chat_in(GaimConnection *g, int id, char *who,
1351 int whisper, char *message, time_t mtime) 1351 int whisper, char *message, time_t mtime)
1352 { 1352 {
1353 int w; 1353 int w;
1354 GSList *bcs; 1354 GSList *bcs;
1355 struct gaim_conversation *conv = NULL; 1355 GaimConversation *conv = NULL;
1356 struct gaim_chat *chat = NULL; 1356 GaimChat *chat = NULL;
1357 char *buf; 1357 char *buf;
1358 char *buffy, *angel; 1358 char *buffy, *angel;
1359 int plugin_return; 1359 int plugin_return;
1360 1360
1361 for (bcs = g->buddy_chats; bcs != NULL; bcs = bcs->next) { 1361 for (bcs = g->buddy_chats; bcs != NULL; bcs = bcs->next) {
1362 conv = (struct gaim_conversation *)bcs->data; 1362 conv = (GaimConversation *)bcs->data;
1363 1363
1364 chat = GAIM_CHAT(conv); 1364 chat = GAIM_CHAT(conv);
1365 1365
1366 if (gaim_chat_get_id(chat) == id) 1366 if (gaim_chat_get_id(chat) == id)
1367 break; 1367 break;