Mercurial > pidgin.yaz
annotate plugins/musicmessaging/musicmessaging.c @ 11417:a9ec436535bc
[gaim-migrate @ 13654]
- Fixed up for dbus
- Receives MM specific messages.
- Handshaking protocol complete.
NOTE: stuff is commented for testing. Will be fixed shortly.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Muise <christian.muise@gmail.com> |
---|---|
date | Fri, 02 Sep 2005 00:40:22 +0000 |
parents | 817e52833803 |
children | 29aaa7d29015 |
rev | line source |
---|---|
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
1 /* |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
2 * Music messaging plugin for Gaim |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
3 * |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
4 * Copyright (C) 2005 Christian Muise. |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
5 * |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
6 * This program is free software; you can redistribute it and/or |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
7 * modify it under the terms of the GNU General Public License as |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
8 * published by the Free Software Foundation; either version 2 of the |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
9 * License, or (at your option) any later version. |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
10 * |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
11 * This program is distributed in the hope that it will be useful, but |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
12 * WITHOUT ANY WARRANTY; without even the implied warranty of |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
14 * General Public License for more details. |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
15 * |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
16 * You should have received a copy of the GNU General Public License |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
17 * along with this program; if not, write to the Free Software |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
19 * 02111-1307, USA. |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
20 */ |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
21 |
11108
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
22 #include "internal.h" |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
23 #include "gtkgaim.h" |
11088
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
24 |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
25 #include "conversation.h" |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
26 |
11108
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
27 #include "gtkconv.h" |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
28 #include "gtkplugin.h" |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
29 #include "gtkutils.h" |
11088
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
30 |
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
31 #include "notify.h" |
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
32 #include "version.h" |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
33 #include "debug.h" |
11108
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
34 |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
35 #define DBUS_API_SUBJECT_TO_CHANGE |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
36 #include <dbus/dbus.h> |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
37 #include "dbus-maybe.h" |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
38 #include "dbus-bindings.h" |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
39 #include "dbus-server.h" |
11365
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
40 #include "dbus-gaim.h" |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
41 |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
42 #define MUSICMESSAGING_PLUGIN_ID "gtk-hazure-musicmessaging" |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
43 #define MUSICMESSAGING_PREFIX "##MM##" |
11362
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
44 #define MUSICMESSAGING_START_MSG "A music messaging session has been requested. Please click the MM icon to accept." |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
45 #define MUSICMESSAGING_CONFIRM_MSG "Music messaging session confirmed." |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
46 |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
47 typedef struct { |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
48 GaimConversation *conv; /* pointer to the conversation */ |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
49 GtkWidget *seperator; /* seperator in the conversation */ |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
50 GtkWidget *button; /* button in the conversation */ |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
51 GPid pid; /* the pid of the score editor */ |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
52 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
53 gboolean started; /* session has started and editor run */ |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
54 gboolean originator; /* started the mm session */ |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
55 gboolean requested; /* received a request to start a session */ |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
56 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
57 } MMConversation; |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
58 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
59 static gboolean start_session(MMConversation *mmconv); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
60 static void run_editor(MMConversation *mmconv); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
61 static void kill_editor(MMConversation *mmconv); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
62 static void add_button (MMConversation *mmconv); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
63 static void remove_widget (GtkWidget *button); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
64 static void init_conversation (GaimConversation *conv); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
65 static void conv_destroyed(GaimConversation *conv); |
11362
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
66 static gboolean intercept_sent(GaimAccount *account, GaimConversation *conv, char **message, void* pData); |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
67 static gboolean intercept_received(GaimAccount *account, char **sender, char **message, GaimConversation *conv, int *flags); |
11417
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
68 static gboolean send_change_request (const int session, const char *id, const char *command, const char *parameters); |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
69 static gboolean send_change_confirmed (const int session, const char *command, const char *parameters); |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
70 static void session_end (MMConversation *mmconv); |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
71 |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
72 /* Globals */ |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
73 /* List of sessions */ |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
74 GList *conversations; |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
75 |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
76 /* Pointer to this plugin */ |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
77 GaimPlugin *plugin_pointer; |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
78 |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
79 /* Define types needed for DBus */ |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
80 DBusGConnection *connection; |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
81 DBusGProxy *proxy; |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
82 #define DBUS_SERVICE_GSCORE "org.gscore.GScoreService" |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
83 #define DBUS_PATH_GSCORE "/org/gscore/GScoreObject" |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
84 #define DBUS_INTERFACE_GSCORE "org.gscore.GScoreInterface" |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
85 |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
86 /* Define the functions to export for use with DBus */ |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
87 DBUS_EXPORT void music_messaging_change_request (const int session, const char *command, const char *parameters); |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
88 DBUS_EXPORT void music_messaging_change_confirmed (const int session, const char *command, const char *parameters); |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
89 DBUS_EXPORT void music_messaging_change_failed (const int session, const char *id, const char *command, const char *parameters); |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
90 DBUS_EXPORT void music_messaging_done_session (const int session); |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
91 |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
92 /* This file has been generated by the #dbus-analize-functions.py |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
93 script. It contains dbus wrappers for the four functions declared |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
94 above. */ |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
95 #include "music-messaging-bindings.c" |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
96 |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
97 /* Exported functions */ |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
98 void music_messaging_change_request(const int session, const char *command, const char *parameters) |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
99 { |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
100 |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
101 MMConversation *mmconv = (MMConversation *)g_list_nth_data(conversations, session); |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
102 |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
103 if (mmconv->started) |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
104 { |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
105 if (mmconv->originator) |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
106 { |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
107 char *name = (mmconv->conv)->name; |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
108 send_change_request (session, name, command, parameters); |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
109 } else |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
110 { |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
111 GString *to_send = g_string_new(""); |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
112 g_string_append_printf(to_send, "##MM## request %s %s##MM##", command, parameters); |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
113 |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
114 gaim_conv_im_send(GAIM_CONV_IM(mmconv->conv), to_send->str); |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
115 |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
116 gaim_debug_misc("Sent request: %s\n", to_send->str); |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
117 } |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
118 } |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
119 |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
120 } |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
121 |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
122 void music_messaging_change_confirmed(const int session, const char *command, const char *parameters) |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
123 { |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
124 gaim_notify_message(plugin_pointer, GAIM_NOTIFY_MSG_INFO, command, |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
125 parameters, NULL, NULL, NULL); |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
126 |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
127 MMConversation *mmconv = (MMConversation *)g_list_nth_data(conversations, session); |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
128 |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
129 if (mmconv->started) |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
130 { |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
131 if (mmconv->originator) |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
132 { |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
133 GString *to_send = g_string_new(""); |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
134 g_string_append_printf(to_send, "##MM## confirm %s %s##MM##", command, parameters); |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
135 |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
136 gaim_conv_im_send(GAIM_CONV_IM(mmconv->conv), to_send->str); |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
137 send_change_confirmed(session, command, parameters); |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
138 } else |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
139 { |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
140 /* Do nothing. If they aren't the originator, then they can't confirm. */ |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
141 } |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
142 } |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
143 |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
144 } |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
145 |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
146 void music_messaging_change_failed(const int session, const char *id, const char *command, const char *parameters) |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
147 { |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
148 gaim_notify_message(plugin_pointer, GAIM_NOTIFY_MSG_INFO, command, |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
149 parameters, NULL, NULL, NULL); |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
150 |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
151 MMConversation *mmconv = (MMConversation *)g_list_nth_data(conversations, session); |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
152 |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
153 if (mmconv->started) |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
154 { |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
155 if (mmconv->originator) |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
156 { |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
157 GString *to_send = g_string_new(""); |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
158 g_string_append_printf(to_send, "##MM## failed %s %s %s##MM##", id, command, parameters); |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
159 |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
160 gaim_conv_im_send(GAIM_CONV_IM(mmconv->conv), to_send->str); |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
161 } else |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
162 { |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
163 /* Do nothing. If they aren't the originator, then they can't confirm. */ |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
164 } |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
165 } |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
166 } |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
167 |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
168 void music_messaging_done_session(const int session) |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
169 { |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
170 gaim_notify_message(plugin_pointer, GAIM_NOTIFY_MSG_INFO, "Session", |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
171 "Session Complete", NULL, NULL, NULL); |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
172 |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
173 MMConversation *mmconv = (MMConversation *)g_list_nth_data(conversations, session); |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
174 |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
175 session_end(mmconv); |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
176 } |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
177 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
178 |
11355
6903f2f6d61f
[gaim-migrate @ 13574]
Christian Muise <christian.muise@gmail.com>
parents:
11254
diff
changeset
|
179 /* DBus commands that can be sent to the editor */ |
11417
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
180 G_BEGIN_DECLS |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
181 DBusConnection *gaim_dbus_get_connection(void); |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
182 G_END_DECLS |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
183 |
11417
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
184 static gboolean send_change_request (const int session, const char *id, const char *command, const char *parameters) |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
185 { |
11417
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
186 DBusMessage *message; |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
187 |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
188 /* Create the signal we need */ |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
189 message = dbus_message_new_signal (DBUS_PATH_GAIM, DBUS_INTERFACE_GAIM, "GscoreChangeRequest"); |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
190 |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
191 /* Append the string "Ping!" to the signal */ |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
192 dbus_message_append_args (message, |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
193 DBUS_TYPE_INT32, &session, |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
194 DBUS_TYPE_STRING, &id, |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
195 DBUS_TYPE_STRING, &command, |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
196 DBUS_TYPE_STRING, ¶meters, |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
197 DBUS_TYPE_INVALID); |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
198 |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
199 /* Send the signal */ |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
200 dbus_connection_send (gaim_dbus_get_connection(), message, NULL); |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
201 |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
202 /* Free the signal now we have finished with it */ |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
203 dbus_message_unref (message); |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
204 |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
205 /* Tell the user we sent a signal */ |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
206 g_printerr("Sent change request signal: %d %s %s %s\n", session, id, command, parameters); |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
207 |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
208 return TRUE; |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
209 } |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
210 |
11417
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
211 static gboolean send_change_confirmed (const int session, const char *command, const char *parameters) |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
212 { |
11417
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
213 DBusMessage *message; |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
214 |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
215 /* Create the signal we need */ |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
216 message = dbus_message_new_signal (DBUS_PATH_GAIM, DBUS_INTERFACE_GAIM, "GscoreChangeConfirmed"); |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
217 |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
218 /* Append the string "Ping!" to the signal */ |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
219 dbus_message_append_args (message, |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
220 DBUS_TYPE_INT32, &session, |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
221 DBUS_TYPE_STRING, &command, |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
222 DBUS_TYPE_STRING, ¶meters, |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
223 DBUS_TYPE_INVALID); |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
224 |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
225 /* Send the signal */ |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
226 dbus_connection_send (gaim_dbus_get_connection(), message, NULL); |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
227 |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
228 /* Free the signal now we have finished with it */ |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
229 dbus_message_unref (message); |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
230 |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
231 /* Tell the user we sent a signal */ |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
232 g_printerr("Sent change confirmed signal.\n"); |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
233 |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
234 return TRUE; |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
235 } |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
236 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
237 |
11417
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
238 static int |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
239 mmconv_from_conv_loc(GaimConversation *conv) |
11362
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
240 { |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
241 MMConversation *mmconv_current = NULL; |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
242 guint i; |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
243 |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
244 for (i = 0; i < g_list_length(conversations); i++) |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
245 { |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
246 mmconv_current = (MMConversation *)g_list_nth_data(conversations, i); |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
247 if (conv == mmconv_current->conv) |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
248 { |
11417
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
249 return i; |
11362
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
250 } |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
251 } |
11417
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
252 return -1; |
11362
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
253 } |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
254 |
11417
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
255 static MMConversation* |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
256 mmconv_from_conv(GaimConversation *conv) |
11365
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
257 { |
11417
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
258 return (MMConversation *)g_list_nth_data(conversations, mmconv_from_conv_loc(conv)); |
11365
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
259 } |
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
260 |
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
261 static gboolean |
11088
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
262 plugin_load(GaimPlugin *plugin) { |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
263 /* First, we have to register our four exported functions with the |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
264 main gaim dbus loop. Without this statement, the gaim dbus |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
265 code wouldn't know about our functions. */ |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
266 GAIM_DBUS_REGISTER_BINDINGS(plugin); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
267 |
11365
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
268 |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
269 gaim_notify_message(plugin, GAIM_NOTIFY_MSG_INFO, "Welcome", |
11108
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
270 "Welcome to music messaging.", NULL, NULL, NULL); |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
271 /* Keep the plugin for reference (needed for notify's) */ |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
272 plugin_pointer = plugin; |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
273 |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
274 /* Add the button to all the current conversations */ |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
275 gaim_conversation_foreach (init_conversation); |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
276 |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
277 /* Listen for any new conversations */ |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
278 void *conv_list_handle = gaim_conversations_get_handle(); |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
279 |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
280 gaim_signal_connect(conv_list_handle, "conversation-created", |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
281 plugin, GAIM_CALLBACK(init_conversation), NULL); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
282 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
283 /* Listen for conversations that are ending */ |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
284 gaim_signal_connect(conv_list_handle, "deleting-conversation", |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
285 plugin, GAIM_CALLBACK(conv_destroyed), NULL); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
286 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
287 /* Listen for sending/receiving messages to replace tags */ |
11417
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
288 gaim_signal_connect(conv_list_handle, "displaying-im-msg", |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
289 plugin, GAIM_CALLBACK(intercept_sent), NULL); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
290 gaim_signal_connect(conv_list_handle, "receiving-im-msg", |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
291 plugin, GAIM_CALLBACK(intercept_received), NULL); |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
292 |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
293 return TRUE; |
11088
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
294 } |
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
295 |
11108
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
296 static gboolean |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
297 plugin_unload(GaimPlugin *plugin) { |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
298 |
11108
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
299 gaim_notify_message(plugin, GAIM_NOTIFY_MSG_INFO, "Unloaded", |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
300 DATADIR, NULL, NULL, NULL); |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
301 |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
302 MMConversation *mmconv = NULL; |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
303 while (g_list_length(conversations) > 0) |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
304 { |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
305 mmconv = g_list_first(conversations)->data; |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
306 conv_destroyed(mmconv->conv); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
307 } |
11108
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
308 return TRUE; |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
309 } |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
310 |
11362
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
311 |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
312 |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
313 static gboolean |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
314 intercept_sent(GaimAccount *account, GaimConversation *conv, char **message, void* pData) |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
315 { |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
316 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
317 if (0 == strncmp(*message, MUSICMESSAGING_PREFIX, strlen(MUSICMESSAGING_PREFIX))) |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
318 { |
11362
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
319 gaim_debug_misc("gaim-musicmessaging", "Sent MM Message: %s\n", *message); |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
320 message = 0; |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
321 } |
11362
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
322 else if (0 == strncmp(*message, MUSICMESSAGING_START_MSG, strlen(MUSICMESSAGING_START_MSG))) |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
323 { |
11362
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
324 gaim_debug_misc("gaim-musicmessaging", "Sent MM request.\n"); |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
325 message = 0; |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
326 } |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
327 else if (0 == strncmp(*message, MUSICMESSAGING_CONFIRM_MSG, strlen(MUSICMESSAGING_CONFIRM_MSG))) |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
328 { |
11365
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
329 gaim_debug_misc("gaim-musicmessaging", "Sent MM confirm.\n"); |
11362
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
330 message = 0; |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
331 } |
11365
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
332 else if (0 == strncmp(*message, "test1", strlen("test1"))) |
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
333 { |
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
334 gaim_debug_misc("gaim-musicmessaging", "\n\nTEST 1\n\n"); |
11417
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
335 send_change_request(0, "test-id", "test-command", "test-parameters"); |
11365
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
336 return FALSE; |
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
337 } |
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
338 else if (0 == strncmp(*message, "test2", strlen("test2"))) |
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
339 { |
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
340 gaim_debug_misc("gaim-musicmessaging", "\n\nTEST 2\n\n"); |
11417
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
341 send_change_confirmed(1, "test-command", "test-parameters"); |
11365
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
342 return FALSE; |
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
343 } |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
344 else |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
345 { |
11362
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
346 return FALSE; |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
347 /* Do nothing...procceed as normal */ |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
348 } |
11362
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
349 return TRUE; |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
350 } |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
351 |
11362
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
352 static gboolean |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
353 intercept_received(GaimAccount *account, char **sender, char **message, GaimConversation *conv, int *flags) |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
354 { |
11362
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
355 MMConversation *mmconv = mmconv_from_conv(conv); |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
356 |
11362
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
357 gaim_debug_misc("gaim-musicmessaging", "Intercepted: %s\n", *message); |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
358 if (strstr(*message, MUSICMESSAGING_PREFIX)) |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
359 { |
11417
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
360 char *parsed_message = strtok(strstr(*message, MUSICMESSAGING_PREFIX), "<"); |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
361 gaim_debug_misc("gaim-musicmessaging", "Received an MM Message: %s\n", parsed_message); |
11362
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
362 |
11417
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
363 if (mmconv->started) |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
364 { |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
365 if (strstr(parsed_message, "request")) |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
366 { |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
367 if (mmconv->originator) |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
368 { |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
369 gaim_debug_misc("gaim-musicmessaging", "Sending request to gscore.\n"); |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
370 |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
371 int session = mmconv_from_conv_loc(conv); |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
372 char *id = (mmconv->conv)->name; |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
373 |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
374 /* Get past the first two terms - '##MM##' and 'request' */ |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
375 strtok(parsed_message, " "); /* '##MM##' */ |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
376 strtok(NULL, " "); /* 'request' */ |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
377 |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
378 char *command = strtok(NULL, " "); |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
379 char *parameters = strtok(NULL, "#"); |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
380 |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
381 send_change_request (session, id, command, parameters); |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
382 |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
383 } |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
384 } else if (strstr(parsed_message, "confirm")) |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
385 { |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
386 if (!mmconv->originator) |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
387 { |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
388 gaim_debug_misc("gaim-musicmessaging", "Sending confirmation to gscore.\n"); |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
389 |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
390 int session = mmconv_from_conv_loc(conv); |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
391 |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
392 /* Get past the first two terms - '##MM##' and 'confirm' */ |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
393 strtok(parsed_message, " "); /* '##MM##' */ |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
394 strtok(NULL, " "); /* 'confirm' */ |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
395 |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
396 char *command = strtok(NULL, " "); |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
397 char *parameters = strtok(NULL, "#"); |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
398 |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
399 send_change_confirmed (session, command, parameters); |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
400 } |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
401 } else if (strstr(parsed_message, "failed")) |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
402 { |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
403 /* Get past the first two terms - '##MM##' and 'confirm' */ |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
404 strtok(parsed_message, " "); /* '##MM##' */ |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
405 strtok(NULL, " "); /* 'failed' */ |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
406 |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
407 char *id = strtok(NULL, " "); |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
408 char *command = strtok(NULL, " "); |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
409 /* char *parameters = strtok(NULL, "#"); DONT NEED PARAMETERS */ |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
410 |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
411 if ((mmconv->conv)->name == id) |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
412 { |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
413 gaim_notify_message(plugin_pointer, GAIM_NOTIFY_MSG_ERROR, "Music Messaging", |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
414 "There was a conflict in running the command:", command, NULL, NULL); |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
415 } |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
416 } |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
417 } |
11362
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
418 |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
419 message = 0; |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
420 } |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
421 else if (strstr(*message, MUSICMESSAGING_START_MSG)) |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
422 { |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
423 message = 0; |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
424 gaim_debug_misc("gaim-musicmessaging", "Received MM request.\n"); |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
425 if (!(mmconv->originator)) |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
426 { |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
427 mmconv->requested = TRUE; |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
428 return FALSE; |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
429 } |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
430 |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
431 } |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
432 else if (strstr(*message, MUSICMESSAGING_CONFIRM_MSG)) |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
433 { |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
434 message = 0; |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
435 gaim_debug_misc("gaim-musicmessagin", "Received MM confirm.\n"); |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
436 |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
437 if (mmconv->originator) |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
438 { |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
439 start_session(mmconv); |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
440 } |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
441 } |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
442 else |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
443 { |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
444 return FALSE; |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
445 /* Do nothing. */ |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
446 } |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
447 return TRUE; |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
448 } |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
449 |
11362
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
450 static void send_request(MMConversation *mmconv) |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
451 { |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
452 GaimConnection *connection = gaim_conversation_get_gc(mmconv->conv); |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
453 const char *convName = gaim_conversation_get_name(mmconv->conv); |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
454 serv_send_im(connection, convName, MUSICMESSAGING_START_MSG, GAIM_MESSAGE_SEND); |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
455 } |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
456 |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
457 static void send_request_confirmed(MMConversation *mmconv) |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
458 { |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
459 GaimConnection *connection = gaim_conversation_get_gc(mmconv->conv); |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
460 const char *convName = gaim_conversation_get_name(mmconv->conv); |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
461 serv_send_im(connection, convName, MUSICMESSAGING_CONFIRM_MSG, GAIM_MESSAGE_SEND); |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
462 } |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
463 |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
464 |
11108
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
465 static gboolean |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
466 start_session(MMConversation *mmconv) |
11362
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
467 { |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
468 run_editor(mmconv); |
11108
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
469 return TRUE; |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
470 } |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
471 |
11417
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
472 static void session_end (MMConversation *mmconv) |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
473 { |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
474 mmconv->started = FALSE; |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
475 mmconv->originator = FALSE; |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
476 mmconv->requested = FALSE; |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
477 kill_editor(mmconv); |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
478 } |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
479 |
11169
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
480 static void music_button_toggled (GtkWidget *widget, gpointer data) |
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
481 { |
11417
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
482 MMConversation *mmconv = mmconv_from_conv(((MMConversation *) data)->conv); |
11169
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
483 if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget))) |
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
484 { |
11417
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
485 //if (((MMConversation *) data)->requested) |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
486 //{ |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
487 if (!mmconv){ g_printerr("DEBUG: About to bust\n"); } |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
488 start_session(mmconv); |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
489 send_request_confirmed(mmconv); |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
490 /*} |
11362
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
491 else |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
492 { |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
493 ((MMConversation *) data)->originator = TRUE; |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
494 send_request((MMConversation *) data); |
11417
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
495 }*/ |
11169
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
496 } else { |
11417
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
497 session_end((MMConversation *)data); |
11169
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
498 } |
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
499 } |
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
500 |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
501 static void set_editor_path (GtkWidget *button, GtkWidget *text_field) |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
502 { |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
503 const char * path = gtk_entry_get_text((GtkEntry*)text_field); |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
504 gaim_prefs_set_string("/plugins/gtk/musicmessaging/editor_path", path); |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
505 |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
506 } |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
507 |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
508 static void run_editor (MMConversation *mmconv) |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
509 { |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
510 GError *spawn_error = NULL; |
11417
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
511 gchar * args[4]; |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
512 args[0] = (gchar *)gaim_prefs_get_string("/plugins/gtk/musicmessaging/editor_path"); |
11417
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
513 |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
514 args[1] = "-session_id"; |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
515 GString *session_id = g_string_new(""); |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
516 g_string_sprintfa(session_id, "%d", mmconv_from_conv_loc(mmconv->conv)); |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
517 args[2] = session_id->str; |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
518 |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
519 args[3] = NULL; |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
520 |
a9ec436535bc
[gaim-migrate @ 13654]
Christian Muise <christian.muise@gmail.com>
parents:
11365
diff
changeset
|
521 if (!(g_spawn_async (".", args, NULL, 4, NULL, NULL, &(mmconv->pid), &spawn_error))) |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
522 { |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
523 gaim_notify_error(plugin_pointer, "Error Running Editor", |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
524 "The following error has occured:", spawn_error->message); |
11254
ce3b9969b399
[gaim-migrate @ 13426]
Christian Muise <christian.muise@gmail.com>
parents:
11216
diff
changeset
|
525 mmconv->started = FALSE; |
ce3b9969b399
[gaim-migrate @ 13426]
Christian Muise <christian.muise@gmail.com>
parents:
11216
diff
changeset
|
526 } |
ce3b9969b399
[gaim-migrate @ 13426]
Christian Muise <christian.muise@gmail.com>
parents:
11216
diff
changeset
|
527 else |
ce3b9969b399
[gaim-migrate @ 13426]
Christian Muise <christian.muise@gmail.com>
parents:
11216
diff
changeset
|
528 { |
ce3b9969b399
[gaim-migrate @ 13426]
Christian Muise <christian.muise@gmail.com>
parents:
11216
diff
changeset
|
529 mmconv->started = TRUE; |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
530 } |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
531 } |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
532 |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
533 static void kill_editor (MMConversation *mmconv) |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
534 { |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
535 if (mmconv->pid) |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
536 { |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
537 kill(mmconv->pid, SIGINT); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
538 mmconv->pid = 0; |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
539 } |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
540 } |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
541 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
542 static void init_conversation (GaimConversation *conv) |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
543 { |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
544 MMConversation *mmconv; |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
545 mmconv = g_malloc(sizeof(MMConversation)); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
546 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
547 mmconv->conv = conv; |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
548 mmconv->started = FALSE; |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
549 mmconv->originator = FALSE; |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
550 mmconv->requested = FALSE; |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
551 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
552 add_button(mmconv); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
553 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
554 conversations = g_list_append(conversations, mmconv); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
555 } |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
556 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
557 static void conv_destroyed (GaimConversation *conv) |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
558 { |
11362
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
559 MMConversation *mmconv = mmconv_from_conv(conv); |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
560 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
561 remove_widget(mmconv->button); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
562 remove_widget(mmconv->seperator); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
563 if (mmconv->started) |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
564 { |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
565 kill_editor(mmconv); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
566 } |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
567 conversations = g_list_remove(conversations, mmconv); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
568 } |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
569 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
570 static void add_button (MMConversation *mmconv) |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
571 { |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
572 GaimConversation *conv = mmconv->conv; |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
573 |
11169
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
574 GtkWidget *button, *image, *sep; |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
575 |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
576 button = gtk_toggle_button_new(); |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
577 gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE); |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
578 |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
579 g_signal_connect(G_OBJECT(button), "toggled", G_CALLBACK(music_button_toggled), mmconv); |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
580 |
11254
ce3b9969b399
[gaim-migrate @ 13426]
Christian Muise <christian.muise@gmail.com>
parents:
11216
diff
changeset
|
581 /* gchar *file_path = g_build_filename (DATADIR, "pixmaps", "gaim", "buttons", "music.png", NULL); */ |
ce3b9969b399
[gaim-migrate @ 13426]
Christian Muise <christian.muise@gmail.com>
parents:
11216
diff
changeset
|
582 gchar *file_path = "/usr/local/share/pixmaps/gaim/buttons/music.png"; |
ce3b9969b399
[gaim-migrate @ 13426]
Christian Muise <christian.muise@gmail.com>
parents:
11216
diff
changeset
|
583 image = gtk_image_new_from_file(file_path); |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
584 |
11169
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
585 gtk_container_add((GtkContainer *)button, image); |
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
586 |
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
587 sep = gtk_vseparator_new(); |
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
588 |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
589 mmconv->seperator = sep; |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
590 mmconv->button = button; |
11169
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
591 |
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
592 gtk_widget_show(sep); |
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
593 gtk_widget_show(image); |
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
594 gtk_widget_show(button); |
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
595 |
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
596 gtk_box_pack_start(GTK_BOX(GAIM_GTK_CONVERSATION(conv)->toolbar), sep, FALSE, FALSE, 0); |
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
597 gtk_box_pack_start(GTK_BOX(GAIM_GTK_CONVERSATION(conv)->toolbar), button, FALSE, FALSE, 0); |
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
598 } |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
599 |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
600 static void remove_widget (GtkWidget *button) |
11169
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
601 { |
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
602 gtk_widget_hide(button); |
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
603 gtk_widget_destroy(button); |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
604 } |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
605 |
11108
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
606 static GtkWidget * |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
607 get_config_frame(GaimPlugin *plugin) |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
608 { |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
609 GtkWidget *ret; |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
610 GtkWidget *vbox; |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
611 |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
612 GtkWidget *editor_path; |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
613 GtkWidget *editor_path_label; |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
614 GtkWidget *editor_path_button; |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
615 |
11108
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
616 /* Outside container */ |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
617 ret = gtk_vbox_new(FALSE, 18); |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
618 gtk_container_set_border_width(GTK_CONTAINER(ret), 10); |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
619 |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
620 /* Configuration frame */ |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
621 vbox = gaim_gtk_make_frame(ret, _("Music Messaging Configuration")); |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
622 |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
623 /* Path to the score editor */ |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
624 editor_path = gtk_entry_new(); |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
625 editor_path_label = gtk_label_new("Score Editor Path"); |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
626 editor_path_button = gtk_button_new_with_mnemonic(_("_Apply")); |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
627 |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
628 gtk_entry_set_text((GtkEntry*)editor_path, "/usr/local/bin/gscore"); |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
629 |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
630 g_signal_connect(G_OBJECT(editor_path_button), "clicked", |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
631 G_CALLBACK(set_editor_path), editor_path); |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
632 |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
633 gtk_box_pack_start(GTK_BOX(vbox), editor_path_label, FALSE, FALSE, 0); |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
634 gtk_box_pack_start(GTK_BOX(vbox), editor_path, FALSE, FALSE, 0); |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
635 gtk_box_pack_start(GTK_BOX(vbox), editor_path_button, FALSE, FALSE, 0); |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
636 |
11108
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
637 gtk_widget_show_all(ret); |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
638 |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
639 return ret; |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
640 } |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
641 |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
642 static GaimGtkPluginUiInfo ui_info = |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
643 { |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
644 get_config_frame |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
645 }; |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
646 |
11088
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
647 static GaimPluginInfo info = { |
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
648 GAIM_PLUGIN_MAGIC, |
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
649 GAIM_MAJOR_VERSION, |
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
650 GAIM_MINOR_VERSION, |
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
651 GAIM_PLUGIN_STANDARD, |
11108
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
652 GAIM_GTK_PLUGIN_TYPE, |
11088
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
653 0, |
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
654 NULL, |
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
655 GAIM_PRIORITY_DEFAULT, |
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
656 |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
657 MUSICMESSAGING_PLUGIN_ID, |
11108
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
658 "Music Messaging", |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
659 VERSION, |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
660 "Music Messaging Plugin for collabrative composition.", |
11216
1b32ad61e114
[gaim-migrate @ 13348]
Richard Laager <rlaager@wiktel.com>
parents:
11200
diff
changeset
|
661 "The Music Messaging Plugin allows a number of users to simultaneously work on a piece of music by editting a common score in real-time.", |
11108
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
662 "Christian Muise <christian.muise@gmail.com>", |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
663 GAIM_WEBSITE, |
11088
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
664 plugin_load, |
11108
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
665 plugin_unload, |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
666 NULL, |
11108
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
667 &ui_info, |
11088
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
668 NULL, |
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
669 NULL, |
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
670 NULL |
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
671 }; |
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
672 |
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
673 static void |
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
674 init_plugin(GaimPlugin *plugin) { |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
675 gaim_prefs_add_none("/plugins/gtk/musicmessaging"); |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
676 gaim_prefs_add_string("/plugins/gtk/musicmessaging/editor_path", "/usr/local/bin/gscore"); |
11088
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
677 } |
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
678 |
11108
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
679 GAIM_INIT_PLUGIN(musicmessaging, init_plugin, info); |