purple: remove purple >= 2.7.0 flagging
[siplcs.git] / src / purple / purple-dbus-bindings.c
blob924ae10da0351d448b2e50a04278330c4732fdd7
1 /**
2 * @file purple-dbus-bindings.c
4 * pidgin-sipe
6 * Copyright (C) 2017 SIPE Project <http://sipe.sourceforge.net/>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 #ifdef HAVE_CONFIG_H
24 #include "config.h"
25 #endif
27 #include <glib.h>
29 #include "purple-dbus.h"
32 * The contents of this file need to be updated when any line which starts
33 * with DBUS_EXPORT in purple-dbus.h gets added/removed/changed.
35 * You'll need access to the Pidgin source code to update this file:
37 * $ python <path to pidgin>/libpurple/dbus-analyze-functions.py \
38 * --export-only \
39 * src/purple/purple-dbus.h \
40 * >> src/purple/purple-dbus-bindings.c
42 * You'll have to edit the contents manually after running the above command.
46 * The generated xxx_DBUS() functions need to be copied here
48 #ifdef HAVE_VV
49 static DBusMessage*
50 sipe_call_phone_number_DBUS(DBusMessage *message_DBUS, DBusError *error_DBUS) {
51 DBusMessage *reply_DBUS;
52 dbus_int32_t account_ID;
53 PurpleAccount *account;
54 const char *phone_number;
55 dbus_message_get_args(message_DBUS, error_DBUS, DBUS_TYPE_INT32, &account_ID, DBUS_TYPE_STRING, &phone_number, DBUS_TYPE_INVALID);
56 CHECK_ERROR(error_DBUS);
57 PURPLE_DBUS_ID_TO_POINTER(account, account_ID, PurpleAccount, error_DBUS);
58 phone_number = (phone_number && phone_number[0]) ? phone_number : NULL;
59 sipe_call_phone_number(account, phone_number);
60 reply_DBUS = dbus_message_new_method_return (message_DBUS);
61 dbus_message_append_args(reply_DBUS, DBUS_TYPE_INVALID);
62 return reply_DBUS;
64 #endif
66 static DBusMessage*
67 sipe_join_conference_with_organizer_and_id_DBUS(DBusMessage *message_DBUS, DBusError *error_DBUS) {
68 DBusMessage *reply_DBUS;
69 dbus_int32_t account_ID;
70 PurpleAccount *account;
71 const char *organizer;
72 const char *meeting_id;
73 dbus_message_get_args(message_DBUS, error_DBUS, DBUS_TYPE_INT32, &account_ID, DBUS_TYPE_STRING, &organizer, DBUS_TYPE_STRING, &meeting_id, DBUS_TYPE_INVALID);
74 CHECK_ERROR(error_DBUS);
75 PURPLE_DBUS_ID_TO_POINTER(account, account_ID, PurpleAccount, error_DBUS);
76 organizer = (organizer && organizer[0]) ? organizer : NULL;
77 meeting_id = (meeting_id && meeting_id[0]) ? meeting_id : NULL;
78 sipe_join_conference_with_organizer_and_id(account, organizer, meeting_id);
79 reply_DBUS = dbus_message_new_method_return (message_DBUS);
80 dbus_message_append_args(reply_DBUS, DBUS_TYPE_INVALID);
81 return reply_DBUS;
84 static DBusMessage*
85 sipe_join_conference_with_uri_DBUS(DBusMessage *message_DBUS, DBusError *error_DBUS) {
86 DBusMessage *reply_DBUS;
87 dbus_int32_t account_ID;
88 PurpleAccount *account;
89 const char *uri;
90 dbus_message_get_args(message_DBUS, error_DBUS, DBUS_TYPE_INT32, &account_ID, DBUS_TYPE_STRING, &uri, DBUS_TYPE_INVALID);
91 CHECK_ERROR(error_DBUS);
92 PURPLE_DBUS_ID_TO_POINTER(account, account_ID, PurpleAccount, error_DBUS);
93 uri = (uri && uri[0]) ? uri : NULL;
94 sipe_join_conference_with_uri(account, uri);
95 reply_DBUS = dbus_message_new_method_return (message_DBUS);
96 dbus_message_append_args(reply_DBUS, DBUS_TYPE_INVALID);
97 return reply_DBUS;
100 static DBusMessage*
101 sipe_republish_calendar_DBUS(DBusMessage *message_DBUS, DBusError *error_DBUS) {
102 DBusMessage *reply_DBUS;
103 dbus_int32_t account_ID;
104 PurpleAccount *account;
105 dbus_message_get_args(message_DBUS, error_DBUS, DBUS_TYPE_INT32, &account_ID, DBUS_TYPE_INVALID);
106 CHECK_ERROR(error_DBUS);
107 PURPLE_DBUS_ID_TO_POINTER(account, account_ID, PurpleAccount, error_DBUS);
108 sipe_republish_calendar(account);
109 reply_DBUS = dbus_message_new_method_return (message_DBUS);
110 dbus_message_append_args(reply_DBUS, DBUS_TYPE_INVALID);
111 return reply_DBUS;
114 static DBusMessage*
115 sipe_reset_status_DBUS(DBusMessage *message_DBUS, DBusError *error_DBUS) {
116 DBusMessage *reply_DBUS;
117 dbus_int32_t account_ID;
118 PurpleAccount *account;
119 dbus_message_get_args(message_DBUS, error_DBUS, DBUS_TYPE_INT32, &account_ID, DBUS_TYPE_INVALID);
120 CHECK_ERROR(error_DBUS);
121 PURPLE_DBUS_ID_TO_POINTER(account, account_ID, PurpleAccount, error_DBUS);
122 sipe_reset_status(account);
123 reply_DBUS = dbus_message_new_method_return (message_DBUS);
124 dbus_message_append_args(reply_DBUS, DBUS_TYPE_INVALID);
125 return reply_DBUS;
129 * The contents of bindings_DBUS[] need to be copied here
131 PurpleDBusBinding sipe_purple_dbus_bindings[] = {
132 #ifdef HAVE_VV
133 {"SipeCallPhoneNumber", "in\0i\0account\0in\0s\0phone_number\0", sipe_call_phone_number_DBUS},
134 #endif
135 {"SipeJoinConferenceWithOrganizerAndId", "in\0i\0account\0in\0s\0organizer\0in\0s\0meeting_id\0", sipe_join_conference_with_organizer_and_id_DBUS},
136 {"SipeJoinConferenceWithUri", "in\0i\0account\0in\0s\0uri\0", sipe_join_conference_with_uri_DBUS},
137 {"SipeRepublishCalendar", "in\0i\0account\0", sipe_republish_calendar_DBUS},
138 {"SipeResetStatus", "in\0i\0account\0", sipe_reset_status_DBUS},
139 {NULL, NULL, NULL}
143 Local Variables:
144 mode: c
145 c-file-style: "bsd"
146 indent-tabs-mode: t
147 tab-width: 8
148 End: