libpurple/protocols/yahoo/yahoo.c

Sun, 21 Jun 2015 16:30:41 -0500

author
Michael McConville <mmcconville@mykolab.com>
date
Sun, 21 Jun 2015 16:30:41 -0500
changeset 37195
3032113d656e
parent 37163
bdaa6ae19356
permissions
-rw-r--r--

Remove Yahoo! Japan

27556
3daffa5f82dd Very rudimentary start to separate prpls. Removed URI handler from the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
1 /*
3daffa5f82dd Very rudimentary start to separate prpls. Removed URI handler from the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
2 * purple
3daffa5f82dd Very rudimentary start to separate prpls. Removed URI handler from the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
3 *
3daffa5f82dd Very rudimentary start to separate prpls. Removed URI handler from the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
4 * Purple is the legal property of its developers, whose names are too numerous
3daffa5f82dd Very rudimentary start to separate prpls. Removed URI handler from the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
5 * to list here. Please refer to the COPYRIGHT file distributed with this
3daffa5f82dd Very rudimentary start to separate prpls. Removed URI handler from the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
6 * source distribution.
3daffa5f82dd Very rudimentary start to separate prpls. Removed URI handler from the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
7 *
3daffa5f82dd Very rudimentary start to separate prpls. Removed URI handler from the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
8 * This program is free software; you can redistribute it and/or modify
3daffa5f82dd Very rudimentary start to separate prpls. Removed URI handler from the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
9 * it under the terms of the GNU General Public License as published by
3daffa5f82dd Very rudimentary start to separate prpls. Removed URI handler from the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
10 * the Free Software Foundation; either version 2 of the License, or
3daffa5f82dd Very rudimentary start to separate prpls. Removed URI handler from the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
11 * (at your option) any later version.
3daffa5f82dd Very rudimentary start to separate prpls. Removed URI handler from the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
12 *
3daffa5f82dd Very rudimentary start to separate prpls. Removed URI handler from the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
13 * This program is distributed in the hope that it will be useful,
3daffa5f82dd Very rudimentary start to separate prpls. Removed URI handler from the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
3daffa5f82dd Very rudimentary start to separate prpls. Removed URI handler from the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3daffa5f82dd Very rudimentary start to separate prpls. Removed URI handler from the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
16 * GNU General Public License for more details.
3daffa5f82dd Very rudimentary start to separate prpls. Removed URI handler from the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
17 *
3daffa5f82dd Very rudimentary start to separate prpls. Removed URI handler from the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
18 * You should have received a copy of the GNU General Public License
3daffa5f82dd Very rudimentary start to separate prpls. Removed URI handler from the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
19 * along with this program; if not, write to the Free Software
3daffa5f82dd Very rudimentary start to separate prpls. Removed URI handler from the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
3daffa5f82dd Very rudimentary start to separate prpls. Removed URI handler from the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
21 *
3daffa5f82dd Very rudimentary start to separate prpls. Removed URI handler from the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
22 */
3daffa5f82dd Very rudimentary start to separate prpls. Removed URI handler from the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
23
27559
3007dde24778 Add header includes. I still have not yet tested building this.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27557
diff changeset
24 #include "internal.h"
3007dde24778 Add header includes. I still have not yet tested building this.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27557
diff changeset
25
3007dde24778 Add header includes. I still have not yet tested building this.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27557
diff changeset
26 #include <account.h>
27560
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
27 #include <core.h>
36534
c582c94a71ac Refactored yahoo to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34878
diff changeset
28 #include <plugins.h>
27560
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
29
36670
418f1f8581de Add/remove YahooProtocol, YahooJPProtocol via the single yahoo plugin
Ankit Vani <a@nevitus.org>
parents: 36667
diff changeset
30 #include "ymsg.h"
36667
bfdad85c76e6 Build a single library for jabber.
Ankit Vani <a@nevitus.org>
parents: 36663
diff changeset
31 #include "yahoo.h"
27560
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
32 #include "yahoochat.h"
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
33 #include "yahoo_aliases.h"
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
34 #include "yahoo_doodle.h"
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
35 #include "yahoo_filexfer.h"
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
36 #include "yahoo_picture.h"
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
37
36670
418f1f8581de Add/remove YahooProtocol, YahooJPProtocol via the single yahoo plugin
Ankit Vani <a@nevitus.org>
parents: 36667
diff changeset
38 static PurpleProtocol *yahoo_protocol = NULL;
418f1f8581de Add/remove YahooProtocol, YahooJPProtocol via the single yahoo plugin
Ankit Vani <a@nevitus.org>
parents: 36667
diff changeset
39
36663
c61b6dbc1f03 Make protocols unregister their commands when being removed
Ankit Vani <a@nevitus.org>
parents: 36653
diff changeset
40 static GSList *cmds = NULL;
27560
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
41
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
42 static void yahoo_register_commands(void)
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
43 {
36663
c61b6dbc1f03 Make protocols unregister their commands when being removed
Ankit Vani <a@nevitus.org>
parents: 36653
diff changeset
44 PurpleCmdId id;
c61b6dbc1f03 Make protocols unregister their commands when being removed
Ankit Vani <a@nevitus.org>
parents: 36653
diff changeset
45
c61b6dbc1f03 Make protocols unregister their commands when being removed
Ankit Vani <a@nevitus.org>
parents: 36653
diff changeset
46 id = purple_cmd_register("join", "s", PURPLE_CMD_P_PROTOCOL,
27560
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
47 PURPLE_CMD_FLAG_IM | PURPLE_CMD_FLAG_CHAT |
36545
23b59a16c808 Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents: 36544
diff changeset
48 PURPLE_CMD_FLAG_PROTOCOL_ONLY,
37005
702a601fc2ca Update protocol IDs in codebase
Ankit Vani <a@nevitus.org>
parents: 37004
diff changeset
49 "prpl-yahoo", yahoopurple_cmd_chat_join,
27560
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
50 _("join &lt;room&gt;: Join a chat room on the Yahoo network"), NULL);
36663
c61b6dbc1f03 Make protocols unregister their commands when being removed
Ankit Vani <a@nevitus.org>
parents: 36653
diff changeset
51 cmds = g_slist_prepend(cmds, GUINT_TO_POINTER(id));
c61b6dbc1f03 Make protocols unregister their commands when being removed
Ankit Vani <a@nevitus.org>
parents: 36653
diff changeset
52
c61b6dbc1f03 Make protocols unregister their commands when being removed
Ankit Vani <a@nevitus.org>
parents: 36653
diff changeset
53 id = purple_cmd_register("list", "", PURPLE_CMD_P_PROTOCOL,
27560
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
54 PURPLE_CMD_FLAG_IM | PURPLE_CMD_FLAG_CHAT |
36545
23b59a16c808 Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents: 36544
diff changeset
55 PURPLE_CMD_FLAG_PROTOCOL_ONLY,
37005
702a601fc2ca Update protocol IDs in codebase
Ankit Vani <a@nevitus.org>
parents: 37004
diff changeset
56 "prpl-yahoo", yahoopurple_cmd_chat_list,
27560
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
57 _("list: List rooms on the Yahoo network"), NULL);
36663
c61b6dbc1f03 Make protocols unregister their commands when being removed
Ankit Vani <a@nevitus.org>
parents: 36653
diff changeset
58 cmds = g_slist_prepend(cmds, GUINT_TO_POINTER(id));
c61b6dbc1f03 Make protocols unregister their commands when being removed
Ankit Vani <a@nevitus.org>
parents: 36653
diff changeset
59
c61b6dbc1f03 Make protocols unregister their commands when being removed
Ankit Vani <a@nevitus.org>
parents: 36653
diff changeset
60 id = purple_cmd_register("buzz", "", PURPLE_CMD_P_PROTOCOL,
36545
23b59a16c808 Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents: 36544
diff changeset
61 PURPLE_CMD_FLAG_IM | PURPLE_CMD_FLAG_PROTOCOL_ONLY,
37005
702a601fc2ca Update protocol IDs in codebase
Ankit Vani <a@nevitus.org>
parents: 37004
diff changeset
62 "prpl-yahoo", yahoopurple_cmd_buzz,
27560
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
63 _("buzz: Buzz a user to get their attention"), NULL);
36663
c61b6dbc1f03 Make protocols unregister their commands when being removed
Ankit Vani <a@nevitus.org>
parents: 36653
diff changeset
64 cmds = g_slist_prepend(cmds, GUINT_TO_POINTER(id));
c61b6dbc1f03 Make protocols unregister their commands when being removed
Ankit Vani <a@nevitus.org>
parents: 36653
diff changeset
65
c61b6dbc1f03 Make protocols unregister their commands when being removed
Ankit Vani <a@nevitus.org>
parents: 36653
diff changeset
66 id = purple_cmd_register("doodle", "", PURPLE_CMD_P_PROTOCOL,
36545
23b59a16c808 Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents: 36544
diff changeset
67 PURPLE_CMD_FLAG_IM | PURPLE_CMD_FLAG_PROTOCOL_ONLY,
37005
702a601fc2ca Update protocol IDs in codebase
Ankit Vani <a@nevitus.org>
parents: 37004
diff changeset
68 "prpl-yahoo", yahoo_doodle_purple_cmd_start,
27560
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
69 _("doodle: Request user to start a Doodle session"), NULL);
36663
c61b6dbc1f03 Make protocols unregister their commands when being removed
Ankit Vani <a@nevitus.org>
parents: 36653
diff changeset
70 cmds = g_slist_prepend(cmds, GUINT_TO_POINTER(id));
c61b6dbc1f03 Make protocols unregister their commands when being removed
Ankit Vani <a@nevitus.org>
parents: 36653
diff changeset
71 }
c61b6dbc1f03 Make protocols unregister their commands when being removed
Ankit Vani <a@nevitus.org>
parents: 36653
diff changeset
72
c61b6dbc1f03 Make protocols unregister their commands when being removed
Ankit Vani <a@nevitus.org>
parents: 36653
diff changeset
73 static void yahoo_unregister_commands(void)
c61b6dbc1f03 Make protocols unregister their commands when being removed
Ankit Vani <a@nevitus.org>
parents: 36653
diff changeset
74 {
c61b6dbc1f03 Make protocols unregister their commands when being removed
Ankit Vani <a@nevitus.org>
parents: 36653
diff changeset
75 while (cmds) {
c61b6dbc1f03 Make protocols unregister their commands when being removed
Ankit Vani <a@nevitus.org>
parents: 36653
diff changeset
76 PurpleCmdId id = GPOINTER_TO_UINT(cmds->data);
c61b6dbc1f03 Make protocols unregister their commands when being removed
Ankit Vani <a@nevitus.org>
parents: 36653
diff changeset
77 purple_cmd_unregister(id);
c61b6dbc1f03 Make protocols unregister their commands when being removed
Ankit Vani <a@nevitus.org>
parents: 36653
diff changeset
78 cmds = g_slist_delete_link(cmds, cmds);
c61b6dbc1f03 Make protocols unregister their commands when being removed
Ankit Vani <a@nevitus.org>
parents: 36653
diff changeset
79 }
27560
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
80 }
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
81
36637
9b0109ae118d Renamed some prpl stuff to protocol stuff.
Ankit Vani <a@nevitus.org>
parents: 36628
diff changeset
82 static PurpleAccount *find_acct(const char *protocol, const char *acct_id)
27560
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
83 {
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
84 PurpleAccount *acct = NULL;
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
85
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
86 /* If we have a specific acct, use it */
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
87 if (acct_id) {
36637
9b0109ae118d Renamed some prpl stuff to protocol stuff.
Ankit Vani <a@nevitus.org>
parents: 36628
diff changeset
88 acct = purple_accounts_find(acct_id, protocol);
27560
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
89 if (acct && !purple_account_is_connected(acct))
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
90 acct = NULL;
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
91 } else { /* Otherwise find an active account for the protocol */
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
92 GList *l = purple_accounts_get_all();
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
93 while (l) {
36637
9b0109ae118d Renamed some prpl stuff to protocol stuff.
Ankit Vani <a@nevitus.org>
parents: 36628
diff changeset
94 if (!strcmp(protocol, purple_account_get_protocol_id(l->data))
27560
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
95 && purple_account_is_connected(l->data)) {
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
96 acct = l->data;
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
97 break;
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
98 }
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
99 l = l->next;
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
100 }
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
101 }
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
102
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
103 return acct;
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
104 }
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
105
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
106 /* This may not be the best way to do this, but we find the first key w/o a value
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
107 * and assume it is the buddy name */
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
108 static void yahoo_find_uri_novalue_param(gpointer key, gpointer value, gpointer user_data)
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
109 {
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
110 char **retval = user_data;
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
111
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
112 if (value == NULL && *retval == NULL) {
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
113 *retval = key;
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
114 }
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
115 }
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
116
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
117 static gboolean yahoo_uri_handler(const char *proto, const char *cmd, GHashTable *params)
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
118 {
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
119 char *acct_id = g_hash_table_lookup(params, "account");
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
120 PurpleAccount *acct;
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
121
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
122 if (g_ascii_strcasecmp(proto, "ymsgr"))
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
123 return FALSE;
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
124
36670
418f1f8581de Add/remove YahooProtocol, YahooJPProtocol via the single yahoo plugin
Ankit Vani <a@nevitus.org>
parents: 36667
diff changeset
125 acct = find_acct(purple_protocol_get_id(yahoo_protocol), acct_id);
27560
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
126
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
127 if (!acct)
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
128 return FALSE;
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
129
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
130 /* ymsgr:SendIM?screename&m=The+Message */
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
131 if (!g_ascii_strcasecmp(cmd, "SendIM")) {
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
132 char *sname = NULL;
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
133 g_hash_table_foreach(params, yahoo_find_uri_novalue_param, &sname);
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
134 if (sname) {
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
135 char *message = g_hash_table_lookup(params, "m");
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
136
34642
5ef8e33e5bed Refactored sametime and yahoo protocols to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents: 34635
diff changeset
137 PurpleIMConversation *im = purple_conversations_find_im_with_account(
5ef8e33e5bed Refactored sametime and yahoo protocols to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents: 34635
diff changeset
138 sname, acct);
5ef8e33e5bed Refactored sametime and yahoo protocols to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents: 34635
diff changeset
139 if (im == NULL)
5ef8e33e5bed Refactored sametime and yahoo protocols to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents: 34635
diff changeset
140 im = purple_im_conversation_new(acct, sname);
5ef8e33e5bed Refactored sametime and yahoo protocols to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents: 34635
diff changeset
141 purple_conversation_present(PURPLE_CONVERSATION(im));
27560
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
142
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
143 if (message) {
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
144 /* Spaces are encoded as '+' */
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
145 g_strdelimit(message, "+", ' ');
34642
5ef8e33e5bed Refactored sametime and yahoo protocols to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents: 34635
diff changeset
146 purple_conversation_send_confirm(PURPLE_CONVERSATION(im), message);
27560
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
147 }
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
148 }
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
149 /* else
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
150 **If pidgindialogs_im() was in the core, we could use it here.
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
151 * It is all purple_request_* based, but I'm not sure it really belongs in the core
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
152 pidgindialogs_im(); */
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
153
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
154 return TRUE;
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
155 }
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
156 /* ymsgr:Chat?roomname */
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
157 else if (!g_ascii_strcasecmp(cmd, "Chat")) {
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
158 char *rname = NULL;
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
159 g_hash_table_foreach(params, yahoo_find_uri_novalue_param, &rname);
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
160 if (rname) {
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
161 /* This is somewhat hacky, but the params aren't useful after this command */
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
162 g_hash_table_insert(params, g_strdup("room"), g_strdup(rname));
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
163 g_hash_table_insert(params, g_strdup("type"), g_strdup("Chat"));
35499
c4c5e0a670b1 Fix namespaces issues in libpurple.
Ankit Vani <a@nevitus.org>
parents: 34894
diff changeset
164 purple_serv_join_chat(purple_account_get_connection(acct), params);
27560
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
165 }
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
166 /* else
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
167 ** Same as above (except that this would have to be re-written using purple_request_*)
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
168 pidgin_blist_joinchat_show(); */
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
169
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
170 return TRUE;
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
171 }
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
172 /* ymsgr:AddFriend?name */
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
173 else if (!g_ascii_strcasecmp(cmd, "AddFriend")) {
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
174 char *name = NULL;
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
175 g_hash_table_foreach(params, yahoo_find_uri_novalue_param, &name);
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
176 purple_blist_request_add_buddy(acct, name, NULL, NULL);
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
177 return TRUE;
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
178 }
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
179
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
180 return FALSE;
95e7692b99eb Moved functions around and made some no longer static. All the functions
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27559
diff changeset
181 }
27559
3007dde24778 Add header includes. I still have not yet tested building this.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27557
diff changeset
182
27557
08a8cbc0a0ec have a separate hash table function for each prpl.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27556
diff changeset
183 static GHashTable *
08a8cbc0a0ec have a separate hash table function for each prpl.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27556
diff changeset
184 yahoo_get_account_text_table(PurpleAccount *account)
08a8cbc0a0ec have a separate hash table function for each prpl.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27556
diff changeset
185 {
08a8cbc0a0ec have a separate hash table function for each prpl.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27556
diff changeset
186 GHashTable *table;
08a8cbc0a0ec have a separate hash table function for each prpl.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27556
diff changeset
187 table = g_hash_table_new(g_str_hash, g_str_equal);
08a8cbc0a0ec have a separate hash table function for each prpl.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27556
diff changeset
188 g_hash_table_insert(table, "login_label", (gpointer)_("Yahoo ID..."));
08a8cbc0a0ec have a separate hash table function for each prpl.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27556
diff changeset
189 return table;
08a8cbc0a0ec have a separate hash table function for each prpl.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27556
diff changeset
190 }
08a8cbc0a0ec have a separate hash table function for each prpl.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27556
diff changeset
191
36637
9b0109ae118d Renamed some prpl stuff to protocol stuff.
Ankit Vani <a@nevitus.org>
parents: 36628
diff changeset
192 static PurpleWhiteboardOps yahoo_whiteboard_ops =
27556
3daffa5f82dd Very rudimentary start to separate prpls. Removed URI handler from the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
193 {
3daffa5f82dd Very rudimentary start to separate prpls. Removed URI handler from the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
194 yahoo_doodle_start,
3daffa5f82dd Very rudimentary start to separate prpls. Removed URI handler from the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
195 yahoo_doodle_end,
3daffa5f82dd Very rudimentary start to separate prpls. Removed URI handler from the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
196 yahoo_doodle_get_dimensions,
3daffa5f82dd Very rudimentary start to separate prpls. Removed URI handler from the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
197 NULL,
3daffa5f82dd Very rudimentary start to separate prpls. Removed URI handler from the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
198 yahoo_doodle_get_brush,
3daffa5f82dd Very rudimentary start to separate prpls. Removed URI handler from the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
199 yahoo_doodle_set_brush,
3daffa5f82dd Very rudimentary start to separate prpls. Removed URI handler from the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
200 yahoo_doodle_send_draw_list,
3daffa5f82dd Very rudimentary start to separate prpls. Removed URI handler from the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
201 yahoo_doodle_clear,
3daffa5f82dd Very rudimentary start to separate prpls. Removed URI handler from the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
202
3daffa5f82dd Very rudimentary start to separate prpls. Removed URI handler from the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
203 /* padding */
3daffa5f82dd Very rudimentary start to separate prpls. Removed URI handler from the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
204 NULL,
3daffa5f82dd Very rudimentary start to separate prpls. Removed URI handler from the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
205 NULL,
3daffa5f82dd Very rudimentary start to separate prpls. Removed URI handler from the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
206 NULL,
3daffa5f82dd Very rudimentary start to separate prpls. Removed URI handler from the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
207 NULL
3daffa5f82dd Very rudimentary start to separate prpls. Removed URI handler from the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
208 };
3daffa5f82dd Very rudimentary start to separate prpls. Removed URI handler from the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
209
36598
f1efde508b03 Refactored yahoo to use the new protocol API.
Ankit Vani <a@nevitus.org>
parents: 36583
diff changeset
210 static void
36684
ecc74498e088 Refactored other protocols to use instance init
Ankit Vani <a@nevitus.org>
parents: 36678
diff changeset
211 yahoo_protocol_init(PurpleProtocol *protocol)
36598
f1efde508b03 Refactored yahoo to use the new protocol API.
Ankit Vani <a@nevitus.org>
parents: 36583
diff changeset
212 {
f1efde508b03 Refactored yahoo to use the new protocol API.
Ankit Vani <a@nevitus.org>
parents: 36583
diff changeset
213 PurpleAccountOption *option;
f1efde508b03 Refactored yahoo to use the new protocol API.
Ankit Vani <a@nevitus.org>
parents: 36583
diff changeset
214
37004
c8dce7bef0e6 Change protocol IDs to prpl-*
Ankit Vani <a@nevitus.org>
parents: 36985
diff changeset
215 protocol->id = "prpl-yahoo";
36684
ecc74498e088 Refactored other protocols to use instance init
Ankit Vani <a@nevitus.org>
parents: 36678
diff changeset
216 protocol->name = "Yahoo";
ecc74498e088 Refactored other protocols to use instance init
Ankit Vani <a@nevitus.org>
parents: 36678
diff changeset
217 protocol->options = OPT_PROTO_MAIL_CHECK | OPT_PROTO_CHAT_TOPIC |
ecc74498e088 Refactored other protocols to use instance init
Ankit Vani <a@nevitus.org>
parents: 36678
diff changeset
218 OPT_PROTO_AUTHORIZATION_DENIED_MESSAGE;
ecc74498e088 Refactored other protocols to use instance init
Ankit Vani <a@nevitus.org>
parents: 36678
diff changeset
219 protocol->icon_spec = purple_buddy_icon_spec_new("png,gif,jpeg",
36609
637155f87448 Refactored the protocols to use purple_buddy_icon_spec_new()
Ankit Vani <a@nevitus.org>
parents: 36598
diff changeset
220 96, 96, 96, 96, 0,
637155f87448 Refactored the protocols to use purple_buddy_icon_spec_new()
Ankit Vani <a@nevitus.org>
parents: 36598
diff changeset
221 PURPLE_ICON_SCALE_SEND);
36598
f1efde508b03 Refactored yahoo to use the new protocol API.
Ankit Vani <a@nevitus.org>
parents: 36583
diff changeset
222
36684
ecc74498e088 Refactored other protocols to use instance init
Ankit Vani <a@nevitus.org>
parents: 36678
diff changeset
223 protocol->whiteboard_ops = &yahoo_whiteboard_ops;
36598
f1efde508b03 Refactored yahoo to use the new protocol API.
Ankit Vani <a@nevitus.org>
parents: 36583
diff changeset
224
f1efde508b03 Refactored yahoo to use the new protocol API.
Ankit Vani <a@nevitus.org>
parents: 36583
diff changeset
225 option = purple_account_option_int_new(_("Pager port"), "port", YAHOO_PAGER_PORT);
37038
8832d14d7d0c Rename 'protocol_options' field of PurpleProtocol to more appropriate 'account_options'
Ankit Vani <a@nevitus.org>
parents: 37005
diff changeset
226 protocol->account_options = g_list_append(protocol->account_options, option);
36598
f1efde508b03 Refactored yahoo to use the new protocol API.
Ankit Vani <a@nevitus.org>
parents: 36583
diff changeset
227
f1efde508b03 Refactored yahoo to use the new protocol API.
Ankit Vani <a@nevitus.org>
parents: 36583
diff changeset
228 option = purple_account_option_string_new(_("File transfer server"), "xfer_host", YAHOO_XFER_HOST);
37038
8832d14d7d0c Rename 'protocol_options' field of PurpleProtocol to more appropriate 'account_options'
Ankit Vani <a@nevitus.org>
parents: 37005
diff changeset
229 protocol->account_options = g_list_append(protocol->account_options, option);
36598
f1efde508b03 Refactored yahoo to use the new protocol API.
Ankit Vani <a@nevitus.org>
parents: 36583
diff changeset
230
f1efde508b03 Refactored yahoo to use the new protocol API.
Ankit Vani <a@nevitus.org>
parents: 36583
diff changeset
231 option = purple_account_option_string_new(_("Chat room locale"), "room_list_locale", YAHOO_ROOMLIST_LOCALE);
37038
8832d14d7d0c Rename 'protocol_options' field of PurpleProtocol to more appropriate 'account_options'
Ankit Vani <a@nevitus.org>
parents: 37005
diff changeset
232 protocol->account_options = g_list_append(protocol->account_options, option);
36598
f1efde508b03 Refactored yahoo to use the new protocol API.
Ankit Vani <a@nevitus.org>
parents: 36583
diff changeset
233
f1efde508b03 Refactored yahoo to use the new protocol API.
Ankit Vani <a@nevitus.org>
parents: 36583
diff changeset
234 option = purple_account_option_string_new(_("Encoding"), "local_charset", "UTF-8");
37038
8832d14d7d0c Rename 'protocol_options' field of PurpleProtocol to more appropriate 'account_options'
Ankit Vani <a@nevitus.org>
parents: 37005
diff changeset
235 protocol->account_options = g_list_append(protocol->account_options, option);
36598
f1efde508b03 Refactored yahoo to use the new protocol API.
Ankit Vani <a@nevitus.org>
parents: 36583
diff changeset
236
f1efde508b03 Refactored yahoo to use the new protocol API.
Ankit Vani <a@nevitus.org>
parents: 36583
diff changeset
237 option = purple_account_option_bool_new(_("Ignore conference and chatroom invitations"), "ignore_invites", FALSE);
37038
8832d14d7d0c Rename 'protocol_options' field of PurpleProtocol to more appropriate 'account_options'
Ankit Vani <a@nevitus.org>
parents: 37005
diff changeset
238 protocol->account_options = g_list_append(protocol->account_options, option);
36598
f1efde508b03 Refactored yahoo to use the new protocol API.
Ankit Vani <a@nevitus.org>
parents: 36583
diff changeset
239
f1efde508b03 Refactored yahoo to use the new protocol API.
Ankit Vani <a@nevitus.org>
parents: 36583
diff changeset
240 #if 0
f1efde508b03 Refactored yahoo to use the new protocol API.
Ankit Vani <a@nevitus.org>
parents: 36583
diff changeset
241 option = purple_account_option_bool_new(_("Use account proxy for HTTP and HTTPS connections"), "proxy_ssl", FALSE);
37038
8832d14d7d0c Rename 'protocol_options' field of PurpleProtocol to more appropriate 'account_options'
Ankit Vani <a@nevitus.org>
parents: 37005
diff changeset
242 protocol->account_options = g_list_append(protocol->account_options, option);
36598
f1efde508b03 Refactored yahoo to use the new protocol API.
Ankit Vani <a@nevitus.org>
parents: 36583
diff changeset
243
f1efde508b03 Refactored yahoo to use the new protocol API.
Ankit Vani <a@nevitus.org>
parents: 36583
diff changeset
244 option = purple_account_option_string_new(_("Chat room list URL"), "room_list", YAHOO_ROOMLIST_URL);
37038
8832d14d7d0c Rename 'protocol_options' field of PurpleProtocol to more appropriate 'account_options'
Ankit Vani <a@nevitus.org>
parents: 37005
diff changeset
245 protocol->account_options = g_list_append(protocol->account_options, option);
36598
f1efde508b03 Refactored yahoo to use the new protocol API.
Ankit Vani <a@nevitus.org>
parents: 36583
diff changeset
246 #endif
f1efde508b03 Refactored yahoo to use the new protocol API.
Ankit Vani <a@nevitus.org>
parents: 36583
diff changeset
247 }
f1efde508b03 Refactored yahoo to use the new protocol API.
Ankit Vani <a@nevitus.org>
parents: 36583
diff changeset
248
f1efde508b03 Refactored yahoo to use the new protocol API.
Ankit Vani <a@nevitus.org>
parents: 36583
diff changeset
249 static void
36684
ecc74498e088 Refactored other protocols to use instance init
Ankit Vani <a@nevitus.org>
parents: 36678
diff changeset
250 yahoo_protocol_class_init(PurpleProtocolClass *klass)
ecc74498e088 Refactored other protocols to use instance init
Ankit Vani <a@nevitus.org>
parents: 36678
diff changeset
251 {
36737
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
252 klass->login = yahoo_login;
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
253 klass->close = yahoo_close;
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
254 klass->status_types = yahoo_status_types;
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
255 klass->list_icon = yahoo_list_icon;
36684
ecc74498e088 Refactored other protocols to use instance init
Ankit Vani <a@nevitus.org>
parents: 36678
diff changeset
256 }
ecc74498e088 Refactored other protocols to use instance init
Ankit Vani <a@nevitus.org>
parents: 36678
diff changeset
257
ecc74498e088 Refactored other protocols to use instance init
Ankit Vani <a@nevitus.org>
parents: 36678
diff changeset
258 static void
36729
7f9fac14ed60 Temporarily replaced PurpleProtocolInterface with PurpleProtocolClientIface in protocols
Ankit Vani <a@nevitus.org>
parents: 36714
diff changeset
259 yahoo_protocol_client_iface_init(PurpleProtocolClientIface *client_iface)
36598
f1efde508b03 Refactored yahoo to use the new protocol API.
Ankit Vani <a@nevitus.org>
parents: 36583
diff changeset
260 {
36737
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
261 client_iface->get_actions = yahoo_get_actions;
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
262 client_iface->list_emblem = yahoo_list_emblem;
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
263 client_iface->status_text = yahoo_status_text;
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
264 client_iface->tooltip_text = yahoo_tooltip_text;
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
265 client_iface->blist_node_menu = yahoo_blist_node_menu;
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
266 client_iface->normalize = purple_normalize_nocase;
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
267 client_iface->offline_message = yahoo_offline_message;
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
268 client_iface->get_account_text_table = yahoo_get_account_text_table;
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
269 client_iface->get_max_message_size = yahoo_get_max_message_size;
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
270 }
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
271
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
272 static void
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
273 yahoo_protocol_server_iface_init(PurpleProtocolServerIface *server_iface)
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
274 {
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
275 server_iface->get_info = yahoo_get_info;
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
276 server_iface->set_status = yahoo_set_status;
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
277 server_iface->set_idle = yahoo_set_idle;
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
278 server_iface->add_buddy = yahoo_add_buddy;
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
279 server_iface->remove_buddy = yahoo_remove_buddy;
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
280 server_iface->keepalive = yahoo_keepalive;
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
281 server_iface->alias_buddy = yahoo_update_alias;
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
282 server_iface->group_buddy = yahoo_change_buddys_group;
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
283 server_iface->rename_group = yahoo_rename_group;
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
284 server_iface->set_buddy_icon = yahoo_set_buddy_icon;
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
285 }
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
286
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
287 static void
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
288 yahoo_protocol_im_iface_init(PurpleProtocolIMIface *im_iface)
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
289 {
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
290 im_iface->send = yahoo_send_im;
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
291 im_iface->send_typing = yahoo_send_typing;
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
292 }
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
293
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
294 static void
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
295 yahoo_protocol_chat_iface_init(PurpleProtocolChatIface *chat_iface)
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
296 {
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
297 chat_iface->info = yahoo_c_info;
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
298 chat_iface->info_defaults = yahoo_c_info_defaults;
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
299 chat_iface->join = yahoo_c_join;
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
300 chat_iface->get_name = yahoo_get_chat_name;
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
301 chat_iface->invite = yahoo_c_invite;
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
302 chat_iface->leave = yahoo_c_leave;
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
303 chat_iface->send = yahoo_c_send;
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
304 }
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
305
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
306 static void
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
307 yahoo_protocol_privacy_iface_init(PurpleProtocolPrivacyIface *privacy_iface)
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
308 {
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
309 privacy_iface->add_deny = yahoo_add_deny;
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
310 privacy_iface->rem_deny = yahoo_rem_deny;
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
311 privacy_iface->set_permit_deny = yahoo_set_permit_deny;
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
312 }
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
313
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
314 static void
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
315 yahoo_protocol_roomlist_iface_init(PurpleProtocolRoomlistIface *roomlist_iface)
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
316 {
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
317 roomlist_iface->get_list = yahoo_roomlist_get_list;
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
318 roomlist_iface->cancel = yahoo_roomlist_cancel;
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
319 roomlist_iface->expand_category = yahoo_roomlist_expand_category;
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
320 }
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
321
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
322 static void
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
323 yahoo_protocol_attention_iface_init(PurpleProtocolAttentionIface *attention_iface)
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
324 {
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
325 attention_iface->send = yahoo_send_attention;
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
326 attention_iface->get_types = yahoo_attention_types;
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
327 }
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
328
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
329 static void
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
330 yahoo_protocol_xfer_iface_init(PurpleProtocolXferIface *xfer_iface)
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
331 {
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
332 xfer_iface->can_receive = yahoo_can_receive_file;
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
333 xfer_iface->send = yahoo_send_file;
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
334 xfer_iface->new_xfer = yahoo_new_xfer;
36598
f1efde508b03 Refactored yahoo to use the new protocol API.
Ankit Vani <a@nevitus.org>
parents: 36583
diff changeset
335 }
27556
3daffa5f82dd Very rudimentary start to separate prpls. Removed URI handler from the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
336
36714
ec178f7d66da Refactored protocols to use the new type definition macros
Ankit Vani <a@nevitus.org>
parents: 36684
diff changeset
337 PURPLE_DEFINE_TYPE_EXTENDED(
ec178f7d66da Refactored protocols to use the new type definition macros
Ankit Vani <a@nevitus.org>
parents: 36684
diff changeset
338 YahooProtocol, yahoo_protocol, PURPLE_TYPE_PROTOCOL, 0,
36737
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
339
36729
7f9fac14ed60 Temporarily replaced PurpleProtocolInterface with PurpleProtocolClientIface in protocols
Ankit Vani <a@nevitus.org>
parents: 36714
diff changeset
340 PURPLE_IMPLEMENT_INTERFACE_STATIC(PURPLE_TYPE_PROTOCOL_CLIENT_IFACE,
36737
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
341 yahoo_protocol_client_iface_init)
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
342
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
343 PURPLE_IMPLEMENT_INTERFACE_STATIC(PURPLE_TYPE_PROTOCOL_SERVER_IFACE,
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
344 yahoo_protocol_server_iface_init)
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
345
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
346 PURPLE_IMPLEMENT_INTERFACE_STATIC(PURPLE_TYPE_PROTOCOL_IM_IFACE,
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
347 yahoo_protocol_im_iface_init)
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
348
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
349 PURPLE_IMPLEMENT_INTERFACE_STATIC(PURPLE_TYPE_PROTOCOL_CHAT_IFACE,
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
350 yahoo_protocol_chat_iface_init)
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
351
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
352 PURPLE_IMPLEMENT_INTERFACE_STATIC(PURPLE_TYPE_PROTOCOL_PRIVACY_IFACE,
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
353 yahoo_protocol_privacy_iface_init)
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
354
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
355 PURPLE_IMPLEMENT_INTERFACE_STATIC(PURPLE_TYPE_PROTOCOL_ROOMLIST_IFACE,
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
356 yahoo_protocol_roomlist_iface_init)
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
357
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
358 PURPLE_IMPLEMENT_INTERFACE_STATIC(PURPLE_TYPE_PROTOCOL_ATTENTION_IFACE,
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
359 yahoo_protocol_attention_iface_init)
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
360
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
361 PURPLE_IMPLEMENT_INTERFACE_STATIC(PURPLE_TYPE_PROTOCOL_XFER_IFACE,
1ce884985d2d Refactored yahoo, zephyr to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
362 yahoo_protocol_xfer_iface_init)
36714
ec178f7d66da Refactored protocols to use the new type definition macros
Ankit Vani <a@nevitus.org>
parents: 36684
diff changeset
363 );
ec178f7d66da Refactored protocols to use the new type definition macros
Ankit Vani <a@nevitus.org>
parents: 36684
diff changeset
364
36534
c582c94a71ac Refactored yahoo to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34878
diff changeset
365 static PurplePluginInfo *
c582c94a71ac Refactored yahoo to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34878
diff changeset
366 plugin_query(GError **error)
27556
3daffa5f82dd Very rudimentary start to separate prpls. Removed URI handler from the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
367 {
36534
c582c94a71ac Refactored yahoo to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34878
diff changeset
368 return purple_plugin_info_new(
36985
9faafe43603e Rename protocol plugin IDs to prpl-*
Ankit Vani <a@nevitus.org>
parents: 36737
diff changeset
369 "id", "prpl-yahoo",
36670
418f1f8581de Add/remove YahooProtocol, YahooJPProtocol via the single yahoo plugin
Ankit Vani <a@nevitus.org>
parents: 36667
diff changeset
370 "name", "Yahoo Protocols",
36534
c582c94a71ac Refactored yahoo to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34878
diff changeset
371 "version", DISPLAY_VERSION,
c582c94a71ac Refactored yahoo to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34878
diff changeset
372 "category", N_("Protocol"),
36670
418f1f8581de Add/remove YahooProtocol, YahooJPProtocol via the single yahoo plugin
Ankit Vani <a@nevitus.org>
parents: 36667
diff changeset
373 "summary", N_("Yahoo! and Yahoo! JAPAN Protocols Plugin"),
418f1f8581de Add/remove YahooProtocol, YahooJPProtocol via the single yahoo plugin
Ankit Vani <a@nevitus.org>
parents: 36667
diff changeset
374 "description", N_("Yahoo! and Yahoo! JAPAN Protocols Plugin"),
36534
c582c94a71ac Refactored yahoo to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34878
diff changeset
375 "website", PURPLE_WEBSITE,
c582c94a71ac Refactored yahoo to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34878
diff changeset
376 "abi-version", PURPLE_ABI_VERSION,
36653
4084c34c051d Override gplugin info's "flags" property. Added PURPLE_PLUGIN_INFO_FLAGS_INTERNAL and PURPLE_PLUGIN_INFO_FLAGS_AUTO_LOAD.
Ankit Vani <a@nevitus.org>
parents: 36638
diff changeset
377 "flags", PURPLE_PLUGIN_INFO_FLAGS_INTERNAL |
4084c34c051d Override gplugin info's "flags" property. Added PURPLE_PLUGIN_INFO_FLAGS_INTERNAL and PURPLE_PLUGIN_INFO_FLAGS_AUTO_LOAD.
Ankit Vani <a@nevitus.org>
parents: 36638
diff changeset
378 PURPLE_PLUGIN_INFO_FLAGS_AUTO_LOAD,
36534
c582c94a71ac Refactored yahoo to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34878
diff changeset
379 NULL
c582c94a71ac Refactored yahoo to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34878
diff changeset
380 );
c582c94a71ac Refactored yahoo to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34878
diff changeset
381 }
27556
3daffa5f82dd Very rudimentary start to separate prpls. Removed URI handler from the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
382
36534
c582c94a71ac Refactored yahoo to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34878
diff changeset
383 static gboolean
c582c94a71ac Refactored yahoo to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34878
diff changeset
384 plugin_load(PurplePlugin *plugin, GError **error)
27556
3daffa5f82dd Very rudimentary start to separate prpls. Removed URI handler from the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
385 {
36714
ec178f7d66da Refactored protocols to use the new type definition macros
Ankit Vani <a@nevitus.org>
parents: 36684
diff changeset
386 yahoo_protocol_register_type(plugin);
ec178f7d66da Refactored protocols to use the new type definition macros
Ankit Vani <a@nevitus.org>
parents: 36684
diff changeset
387
36670
418f1f8581de Add/remove YahooProtocol, YahooJPProtocol via the single yahoo plugin
Ankit Vani <a@nevitus.org>
parents: 36667
diff changeset
388 yahoo_protocol = purple_protocols_add(YAHOO_TYPE_PROTOCOL, error);
418f1f8581de Add/remove YahooProtocol, YahooJPProtocol via the single yahoo plugin
Ankit Vani <a@nevitus.org>
parents: 36667
diff changeset
389 if (!yahoo_protocol)
36598
f1efde508b03 Refactored yahoo to use the new protocol API.
Ankit Vani <a@nevitus.org>
parents: 36583
diff changeset
390 return FALSE;
28326
6f1bc0dcabdc Add a boolean account option (defaulting to off) to control whether to use
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28198
diff changeset
391
36674
37c56498c80f Register and unregister yahoo commands in plugin load/unload
Ankit Vani <a@nevitus.org>
parents: 36670
diff changeset
392 yahoo_init_colorht();
37c56498c80f Register and unregister yahoo commands in plugin load/unload
Ankit Vani <a@nevitus.org>
parents: 36670
diff changeset
393
37c56498c80f Register and unregister yahoo commands in plugin load/unload
Ankit Vani <a@nevitus.org>
parents: 36670
diff changeset
394 yahoo_register_commands();
37c56498c80f Register and unregister yahoo commands in plugin load/unload
Ankit Vani <a@nevitus.org>
parents: 36670
diff changeset
395
36670
418f1f8581de Add/remove YahooProtocol, YahooJPProtocol via the single yahoo plugin
Ankit Vani <a@nevitus.org>
parents: 36667
diff changeset
396 purple_signal_connect(purple_get_core(), "uri-handler", yahoo_protocol,
27556
3daffa5f82dd Very rudimentary start to separate prpls. Removed URI handler from the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
397 PURPLE_CALLBACK(yahoo_uri_handler), NULL);
36534
c582c94a71ac Refactored yahoo to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34878
diff changeset
398
c582c94a71ac Refactored yahoo to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34878
diff changeset
399 return TRUE;
27556
3daffa5f82dd Very rudimentary start to separate prpls. Removed URI handler from the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
400 }
3daffa5f82dd Very rudimentary start to separate prpls. Removed URI handler from the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
401
36534
c582c94a71ac Refactored yahoo to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34878
diff changeset
402 static gboolean
c582c94a71ac Refactored yahoo to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34878
diff changeset
403 plugin_unload(PurplePlugin *plugin, GError **error)
c582c94a71ac Refactored yahoo to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34878
diff changeset
404 {
36674
37c56498c80f Register and unregister yahoo commands in plugin load/unload
Ankit Vani <a@nevitus.org>
parents: 36670
diff changeset
405 yahoo_unregister_commands();
37c56498c80f Register and unregister yahoo commands in plugin load/unload
Ankit Vani <a@nevitus.org>
parents: 36670
diff changeset
406
37c56498c80f Register and unregister yahoo commands in plugin load/unload
Ankit Vani <a@nevitus.org>
parents: 36670
diff changeset
407 yahoo_dest_colorht();
37c56498c80f Register and unregister yahoo commands in plugin load/unload
Ankit Vani <a@nevitus.org>
parents: 36670
diff changeset
408
36670
418f1f8581de Add/remove YahooProtocol, YahooJPProtocol via the single yahoo plugin
Ankit Vani <a@nevitus.org>
parents: 36667
diff changeset
409 if (!purple_protocols_remove(yahoo_protocol, error))
36598
f1efde508b03 Refactored yahoo to use the new protocol API.
Ankit Vani <a@nevitus.org>
parents: 36583
diff changeset
410 return FALSE;
36534
c582c94a71ac Refactored yahoo to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34878
diff changeset
411
c582c94a71ac Refactored yahoo to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34878
diff changeset
412 return TRUE;
c582c94a71ac Refactored yahoo to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34878
diff changeset
413 }
c582c94a71ac Refactored yahoo to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34878
diff changeset
414
36714
ec178f7d66da Refactored protocols to use the new type definition macros
Ankit Vani <a@nevitus.org>
parents: 36684
diff changeset
415 PURPLE_PLUGIN_INIT(yahoo, plugin_query, plugin_load, plugin_unload);

mercurial