forked from teleshoes/chatpop-pidgin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchatpop.c
94 lines (71 loc) · 2.36 KB
/
chatpop.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#define GETTEXT_PACKAGE "pidgin-chatpop"
#define PURPLE_PLUGINS
#include "internal.h"
#include "account.h"
#include "blist.h"
#include "conversation.h"
#include "debug.h"
#include "signals.h"
#include "status.h"
#include "version.h"
#include "privacy.h"
#include "plugin.h"
#include "pluginpref.h"
#include "prefs.h"
#include "gtkconv.h"
#define PLUGIN_ID "chatpop"
#define PLUGIN_NAME N_("Chatpopper")
#define PLUGIN_SUMMARY N_("Pop up closed buddy chat window on activity")
#define PLUGIN_DESC N_("Causes chat windows for buddies to appear" \
" when activity appears in the chat")
#define PLUGIN_AUTHOR "Paul Cowan <[email protected]>"
#define PLUGIN_VERSION "1.1"
#define PLUGIN_WEBSITE "https://developer.pidgin.im/ticket/5507"
static void
received_chat_msg_cb(PurpleAccount *acct, char *sender, char *buffer,
PurpleConversation *chat, PurpleMessageFlags flags, void *data)
{
pidgin_conv_attach_to_conversation(chat);
}
static gboolean
plugin_load(PurplePlugin *plugin) {
void *convs_handle;
convs_handle = purple_conversations_get_handle();
purple_debug_info(PLUGIN_NAME, _("loaded.\n"));
purple_signal_connect(convs_handle, "received-chat-msg",
plugin, PURPLE_CALLBACK(received_chat_msg_cb), NULL);
return TRUE;
}
static PurplePluginInfo info = {
PURPLE_PLUGIN_MAGIC,
PURPLE_MAJOR_VERSION,
PURPLE_MINOR_VERSION,
PURPLE_PLUGIN_STANDARD, /**< type */
NULL, /**< ui_requirement */
0, /**< flags */
NULL, /**< dependencies */
PURPLE_PRIORITY_DEFAULT, /**< priority */
PLUGIN_ID, /**< id */
PLUGIN_NAME, /**< name */
PLUGIN_VERSION, /**< version */
PLUGIN_SUMMARY, /**< summary */
PLUGIN_DESC, /**< description */
PLUGIN_AUTHOR, /**< author */
PLUGIN_WEBSITE, /**< homepage */
plugin_load, /**< load */
NULL, /**< unload */
NULL, /**< destroy */
NULL, /**< ui_info */
NULL, /**< extra_info */
NULL, /**< prefs_info */
NULL, /**< actions */
/* padding */
NULL,
NULL,
NULL,
NULL
};
static void
init_plugin(PurplePlugin *plugin) {
}
PURPLE_INIT_PLUGIN(chatpop, init_plugin, info)