comparison src/server.c @ 6837:f098765ac919

[gaim-migrate @ 7382] The pounces subsystem now registers signal callbacks for all the pounce types. The calls to pounce code in server.c, and therefore in all the rest of gaim, have been removed. The pounce code is now more like its own separate island. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Sun, 14 Sep 2003 21:05:11 +0000
parents faa491042c66
children 66dd420d3d23
comparison
equal deleted inserted replaced
6836:e2483c5f53bd 6837:f098765ac919
22 #include "conversation.h" 22 #include "conversation.h"
23 #include "debug.h" 23 #include "debug.h"
24 #include "log.h" 24 #include "log.h"
25 #include "multi.h" 25 #include "multi.h"
26 #include "notify.h" 26 #include "notify.h"
27 #include "pounce.h"
28 #include "prefs.h" 27 #include "prefs.h"
29 #include "prpl.h" 28 #include "prpl.h"
30 #include "request.h" 29 #include "request.h"
31 #include "signals.h" 30 #include "signals.h"
32 #include "server.h" 31 #include "server.h"
1115 gaim_blist_rename_buddy(b, name); 1114 gaim_blist_rename_buddy(b, name);
1116 gaim_blist_save(); 1115 gaim_blist_save();
1117 } 1116 }
1118 1117
1119 if (!b->idle && idle) { 1118 if (!b->idle && idle) {
1120 gaim_pounce_execute(gc->account, b->name, GAIM_POUNCE_IDLE);
1121 gaim_signal_emit(gaim_blist_get_handle(), "buddy-idle", b); 1119 gaim_signal_emit(gaim_blist_get_handle(), "buddy-idle", b);
1122 system_log(log_idle, gc, b, OPT_LOG_BUDDY_IDLE); 1120 system_log(log_idle, gc, b, OPT_LOG_BUDDY_IDLE);
1123 } else if (b->idle && !idle) { 1121 } else if (b->idle && !idle) {
1124 gaim_pounce_execute(gc->account, b->name, GAIM_POUNCE_IDLE_RETURN);
1125 gaim_signal_emit(gaim_blist_get_handle(), "buddy-unidle", b); 1122 gaim_signal_emit(gaim_blist_get_handle(), "buddy-unidle", b);
1126 system_log(log_unidle, gc, b, OPT_LOG_BUDDY_IDLE); 1123 system_log(log_unidle, gc, b, OPT_LOG_BUDDY_IDLE);
1127 } 1124 }
1128 1125
1129 gaim_blist_update_buddy_idle(b, idle); 1126 gaim_blist_update_buddy_idle(b, idle);
1130 gaim_blist_update_buddy_evil(b, evil); 1127 gaim_blist_update_buddy_evil(b, evil);
1131 1128
1132 if ((b->uc & UC_UNAVAILABLE) && !(type & UC_UNAVAILABLE)) { 1129 if ((b->uc & UC_UNAVAILABLE) && !(type & UC_UNAVAILABLE))
1133 gaim_pounce_execute(gc->account, b->name, GAIM_POUNCE_AWAY_RETURN);
1134 system_log(log_back, gc, b, OPT_LOG_BUDDY_AWAY); 1130 system_log(log_back, gc, b, OPT_LOG_BUDDY_AWAY);
1135 } else if (!(b->uc & UC_UNAVAILABLE) && (type & UC_UNAVAILABLE)) { 1131 else if (!(b->uc & UC_UNAVAILABLE) && (type & UC_UNAVAILABLE))
1136 gaim_pounce_execute(gc->account, b->name, GAIM_POUNCE_AWAY);
1137 system_log(log_away, gc, b, OPT_LOG_BUDDY_AWAY); 1132 system_log(log_away, gc, b, OPT_LOG_BUDDY_AWAY);
1138 }
1139 1133
1140 gaim_blist_update_buddy_status(b, type); 1134 gaim_blist_update_buddy_status(b, type);
1141 1135
1142 if (loggedin) { 1136 if (loggedin) {
1143 if (!GAIM_BUDDY_IS_ONLINE(b)) { 1137 if (!GAIM_BUDDY_IS_ONLINE(b)) {
1162 qm->len = -1; 1156 qm->len = -1;
1163 message_queue = g_slist_append(message_queue, qm); 1157 message_queue = g_slist_append(message_queue, qm);
1164 } 1158 }
1165 } 1159 }
1166 gaim_sound_play_event(GAIM_SOUND_BUDDY_ARRIVE); 1160 gaim_sound_play_event(GAIM_SOUND_BUDDY_ARRIVE);
1167 gaim_pounce_execute(gc->account, b->name, GAIM_POUNCE_SIGNON);
1168 system_log(log_signon, gc, b, OPT_LOG_BUDDY_SIGNON); 1161 system_log(log_signon, gc, b, OPT_LOG_BUDDY_SIGNON);
1169 } 1162 }
1170 } else { 1163 } else {
1171 if (GAIM_BUDDY_IS_ONLINE(b)) { 1164 if (GAIM_BUDDY_IS_ONLINE(b)) {
1172 1165
1190 message_queue = g_slist_append(message_queue, qm); 1183 message_queue = g_slist_append(message_queue, qm);
1191 } 1184 }
1192 } 1185 }
1193 serv_got_typing_stopped(gc, name); /* obviously not typing */ 1186 serv_got_typing_stopped(gc, name); /* obviously not typing */
1194 gaim_sound_play_event(GAIM_SOUND_BUDDY_LEAVE); 1187 gaim_sound_play_event(GAIM_SOUND_BUDDY_LEAVE);
1195 gaim_pounce_execute(gc->account, b->name, GAIM_POUNCE_SIGNOFF);
1196 system_log(log_signoff, gc, b, OPT_LOG_BUDDY_SIGNON); 1188 system_log(log_signoff, gc, b, OPT_LOG_BUDDY_SIGNON);
1197 } 1189 }
1198 } 1190 }
1199 1191
1200 if (c != NULL) 1192 if (c != NULL)
1254 gaim_im_set_typing_state(im, state); 1246 gaim_im_set_typing_state(im, state);
1255 gaim_im_update_typing(im); 1247 gaim_im_update_typing(im);
1256 1248
1257 b = gaim_find_buddy(gc->account, name); 1249 b = gaim_find_buddy(gc->account, name);
1258 1250
1259 gaim_signal_emit(gaim_conversations_get_handle(), "buddy-typing", cnv); 1251 if (b != NULL)
1260 1252 {
1261 if (b != NULL) {
1262 if (state == GAIM_TYPING) 1253 if (state == GAIM_TYPING)
1263 gaim_pounce_execute(gc->account, name, GAIM_POUNCE_TYPING); 1254 {
1255 gaim_signal_emit(gaim_conversations_get_handle(),
1256 "buddy-typing", cnv);
1257 }
1264 else 1258 else
1265 gaim_pounce_execute(gc->account, name, GAIM_POUNCE_TYPING_STOPPED); 1259 {
1260 gaim_signal_emit(gaim_conversations_get_handle(),
1261 "buddy-typing-stopped", cnv);
1262 }
1266 } 1263 }
1267 1264
1268 if (timeout > 0) 1265 if (timeout > 0)
1269 gaim_im_start_typing_timeout(im, timeout); 1266 gaim_im_start_typing_timeout(im, timeout);
1270 } 1267 }
1288 gaim_im_update_typing(im); 1285 gaim_im_update_typing(im);
1289 1286
1290 b = gaim_find_buddy(gc->account, name); 1287 b = gaim_find_buddy(gc->account, name);
1291 1288
1292 if (b != NULL) 1289 if (b != NULL)
1293 gaim_pounce_execute(gc->account, name, GAIM_POUNCE_TYPING_STOPPED); 1290 {
1291 gaim_signal_emit(gaim_conversations_get_handle(),
1292 "buddy-typing-stopped", c);
1293 }
1294 } 1294 }
1295 1295
1296 struct chat_invite_data { 1296 struct chat_invite_data {
1297 GaimConnection *gc; 1297 GaimConnection *gc;
1298 GHashTable *components; 1298 GHashTable *components;
1369 1369
1370 filename = (char *)malloc(100); 1370 filename = (char *)malloc(100);
1371 g_snprintf(filename, 100, "%s.chat", gaim_conversation_get_name(conv)); 1371 g_snprintf(filename, 100, "%s.chat", gaim_conversation_get_name(conv));
1372 1372
1373 fd = open_log_file(filename, TRUE); 1373 fd = open_log_file(filename, TRUE);
1374 1374
1375 if (fd) { 1375 if (fd) {
1376 if (!gaim_prefs_get_bool("/gaim/gtk/logging/strip_html")) 1376 if (!gaim_prefs_get_bool("/gaim/gtk/logging/strip_html"))
1377 fprintf(fd, 1377 fprintf(fd,
1378 _("<HR><BR><H3 Align=Center> ---- New Conversation @ %s ----</H3><BR>\n"), 1378 _("<HR><BR><H3 Align=Center> ---- New Conversation @ %s ----</H3><BR>\n"),
1379 full_date()); 1379 full_date());