comparison plugins/spellchk.c @ 6780:e9a730ad5a3c

[gaim-migrate @ 7319] Fixed the prototypes and signal registration for displaying-im-msg, displayed-im-msg, displaying-chat-msg, and displayed-chat-msg. This fixes the text replacement plugin (with a minor change or two there as well). committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Sun, 07 Sep 2003 20:02:45 +0000
parents b0913ab92893
children 3c885e6784ee
comparison
equal deleted inserted replaced
6779:f5c483cdd1d8 6780:e9a730ad5a3c
29 static int get_word(char *, int); 29 static int get_word(char *, int);
30 static char *have_word(char *, int); 30 static char *have_word(char *, int);
31 static void substitute(char **, int, int, const char *); 31 static void substitute(char **, int, int, const char *);
32 static GtkListStore *model; 32 static GtkListStore *model;
33 33
34 static void 34 static gboolean
35 substitute_words(GaimAccount *account, GaimConversation *conv, 35 substitute_words(GaimAccount *account, GaimConversation *conv,
36 char **message, void *data) 36 char **message, void *data)
37 { 37 {
38 int i, l; 38 int i, l;
39 int word; 39 int word;
40 char *tmp; 40 char *tmp;
41 41
42 if (message == NULL || *message == NULL) 42 if (message == NULL || *message == NULL)
43 return; 43 return FALSE;
44 44
45 l = num_words(*message); 45 l = num_words(*message);
46 for (i = 0; i < l; i++) { 46 for (i = 0; i < l; i++) {
47 GtkTreeIter iter; 47 GtkTreeIter iter;
48 word = get_word(*message, i); 48 word = get_word(*message, i);
67 g_value_unset(&val0); 67 g_value_unset(&val0);
68 g_value_unset(&val1); 68 g_value_unset(&val1);
69 } while(gtk_tree_model_iter_next(GTK_TREE_MODEL(model), &iter)); 69 } while(gtk_tree_model_iter_next(GTK_TREE_MODEL(model), &iter));
70 } 70 }
71 } 71 }
72
73 return FALSE;
72 } 74 }
73 75
74 static int buf_get_line(char *ibuf, char **buf, int *position, int len) { 76 static int buf_get_line(char *ibuf, char **buf, int *position, int len) {
75 int pos = *position, spos = pos; 77 int pos = *position, spos = pos;
76 78
380 { 382 {
381 void *conv_handle = gaim_conversations_get_handle(); 383 void *conv_handle = gaim_conversations_get_handle();
382 384
383 load_conf(); 385 load_conf();
384 386
385 gaim_signal_connect(conv_handle, "sending-im-msg", 387 gaim_signal_connect(conv_handle, "displaying-im-msg",
386 plugin, GAIM_CALLBACK(substitute_words), NULL); 388 plugin, GAIM_CALLBACK(substitute_words), NULL);
387 gaim_signal_connect(conv_handle, "sending-chat-msg", 389 gaim_signal_connect(conv_handle, "displaying-chat-msg",
388 plugin, GAIM_CALLBACK(substitute_words), NULL); 390 plugin, GAIM_CALLBACK(substitute_words), NULL);
389 391
390 return TRUE; 392 return TRUE;
391 } 393 }
392 394