cleaned gtk and pidgin code from 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 {
30 if (a==NULL) return 1;
31 if (b==NULL) return -1;
32 return strcmp(a,b);
33 }
34
35
36 static void
37 received_im_msg_cb(PurpleAccount *account, char *who, char *buffer,
38 PurpleConversation *conv, PurpleMessageFlags flags, void *data)
39 {
40
41 /* A workaround to avoid skipping of the first message as a result on NULL-conv: */
42 if (conv == NULL) conv=purple_conversation_new(PURPLE_CONV_TYPE_IM, account, who);
43
44 buff = purple_markup_strip_html(buffer);
45 printf("\nHarvie received 1: %s\n", buffer);
46
47 purple_conv_im_send(purple_conversation_get_im_data(conv), ":-*");
48
49 }
50
51 /* Plugin Routine */
52
53 static gboolean
54 plugin_load(PurplePlugin *plugin)
55 {
56 void *conv_handle = purple_conversations_get_handle();
57
58 purple_signal_connect(conv_handle, "received-im-msg",
59 plugin, PURPLE_CALLBACK(received_im_msg_cb), NULL);
60 return TRUE;
61 }
62
63 static gboolean
64 plugin_unload(PurplePlugin *plugin) {
65
66 return TRUE;
67 }
68
69
70 static PurplePluginInfo info = {
71 PURPLE_PLUGIN_MAGIC,
72 PURPLE_MAJOR_VERSION,
73 PURPLE_MINOR_VERSION,
74 PURPLE_PLUGIN_STANDARD,
75 NULL,
76 0,
77 NULL,
78 PURPLE_PRIORITY_DEFAULT,
79
80 "core-autokiss", /**< id */
81 "AutoKiss", /**< name */
82 "0.1", /**< version */
83 /** summary */
84 "Automatically answering based on regexes.",
85 /** description */
86 "Automatically answering based on regexpppppppppppppppp",
87 "Harvie <harvie@email.cz>", /**< author */
88 "http://sourceforge.net/projects/pidgin-autoansw", /**< homepage */
89
90 plugin_load, /**< load */
91 plugin_unload, /**< unload */
92 NULL,
93
94 NULL,
95 NULL,
96 NULL,
97 NULL,
98 NULL,
99 NULL,
100 NULL,
101 NULL
102 };
103
104 static void
105 init_plugin(PurplePlugin *plugin)
106 {
107
108 }
109
110 PURPLE_INIT_PLUGIN(autoanswer, init_plugin, info)
111
112
This page took 0.555752 seconds and 4 git commands to generate.