more cleaning of autoansw.c
[mirrors/Programs.git] / plugins / pidgin-plugins / autokiss / autoansw.c
1 #define PURPLE_PLUGINS
2
3 /* Purple headers */
4 #include <libpurple/debug.h>
5 #include <libpurple/version.h>
6 #include <libpurple/conversation.h>
7 #include <libpurple/debug.h>
8 #include <libpurple/log.h>
9 #include <libpurple/plugin.h>
10 #include <libpurple/pluginpref.h>
11 #include <libpurple/prefs.h>
12 #include <libpurple/signals.h>
13 #include <libpurple/util.h>
14 #include <libpurple/notify.h>
15
16 #include <time.h>
17 #include <string.h>
18 #include <stdio.h>
19 /*
20 #include <sys/stat.h>
21 #include <ftw.h>
22 #include <glib.h>
23 #include <unistd.h>
24 */
25
26 char *buff = NULL;
27
28 gint compare_str(gconstpointer a, gconstpointer b) {
29 if (a == NULL) return 1;
30 if (b == NULL) return -1;
31 return strcmp(a, b);
32 }
33
34 static void
35 received_im_msg_cb(PurpleAccount * account, char *who, char *buffer,
36 PurpleConversation * conv, PurpleMessageFlags flags,
37 void *data) {
38
39 /* A workaround to avoid skipping of the first message as a result on NULL-conv: */
40 if (conv == NULL) conv = purple_conversation_new(PURPLE_CONV_TYPE_IM, account, who);
41
42 buff = purple_markup_strip_html(buffer);
43 printf("\nHarvie received 1: %s\n", buffer);
44
45 purple_conv_im_send(purple_conversation_get_im_data(conv), ":-*");
46
47 }
48
49
50 static gboolean plugin_load(PurplePlugin * plugin) {
51 void *conv_handle = purple_conversations_get_handle();
52
53 purple_signal_connect(conv_handle, "received-im-msg",
54 plugin, PURPLE_CALLBACK(received_im_msg_cb),
55 NULL);
56 return TRUE;
57 }
58
59 static gboolean plugin_unload(PurplePlugin * plugin) {
60 return TRUE;
61 }
62
63 static PurplePluginInfo info = {
64 PURPLE_PLUGIN_MAGIC,
65 PURPLE_MAJOR_VERSION,
66 PURPLE_MINOR_VERSION,
67 PURPLE_PLUGIN_STANDARD,
68 NULL,
69 0,
70 NULL,
71 PURPLE_PRIORITY_DEFAULT,
72
73 "core-autokiss",
74 "AutoKiss",
75 "0.1",
76 "Automatic answering",
77 "Automatically answering based on regexpppppppppppppppp",
78 "Harvie <harvie@email.cz>",
79 "http://sourceforge.net/projects/pidgin-autoansw",
80
81 plugin_load,
82 plugin_unload,
83 NULL,
84 NULL,
85 NULL,
86 NULL,
87 NULL,
88 NULL,
89 NULL,
90 NULL,
91 NULL
92 };
93
94 static void init_plugin(PurplePlugin * plugin) {
95
96 }
97
98 PURPLE_INIT_PLUGIN(autoanswer, init_plugin, info)
99
This page took 0.272119 seconds and 4 git commands to generate.