Wed, 23 Apr 2008 02:29:39 +0000
Use the same fix for Purple::Util::fetch_url (from 4b6378d5e) for
Purple::Request:: functions as well. This allows the callbacks to be
specified both as coderefs or as strings (name of the callback function).
| 11118 | 1 | #include "module.h" |
| 2 | ||
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
3 | MODULE = Purple::Prpl PACKAGE = Purple::Find PREFIX = purple_find_ |
| 11118 | 4 | PROTOTYPES: ENABLE |
| 5 | ||
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
6 | Purple::Plugin |
|
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
7 | purple_find_prpl(id) |
| 11118 | 8 | const char *id |
| 9 | ||
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
10 | MODULE = Purple::Prpl PACKAGE = Purple::Prpl PREFIX = purple_prpl_ |
| 11118 | 11 | PROTOTYPES: ENABLE |
| 12 | ||
| 12792 | 13 | void |
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
14 | purple_prpl_change_account_status(account, old_status, new_status) |
|
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
15 | Purple::Account account |
|
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
16 | Purple::Status old_status |
|
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
17 | Purple::Status new_status |
| 11118 | 18 | |
| 19 | void | |
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
20 | purple_prpl_get_statuses(account, presence) |
|
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
21 | Purple::Account account |
|
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
22 | Purple::Presence presence |
| 11118 | 23 | PREINIT: |
|
21737
fa92350ed598
applied changes from 8d953d5714cb202c5fa66fda1b0f31f01a969622
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15894
diff
changeset
|
24 | GList *l, *ll; |
| 11118 | 25 | PPCODE: |
|
21737
fa92350ed598
applied changes from 8d953d5714cb202c5fa66fda1b0f31f01a969622
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15894
diff
changeset
|
26 | ll = purple_prpl_get_statuses(account,presence); |
|
fa92350ed598
applied changes from 8d953d5714cb202c5fa66fda1b0f31f01a969622
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15894
diff
changeset
|
27 | for (l = ll; l != NULL; l = l->next) { |
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
28 | XPUSHs(sv_2mortal(purple_perl_bless_object(l->data, "Purple::Status"))); |
| 12792 | 29 | } |
|
21737
fa92350ed598
applied changes from 8d953d5714cb202c5fa66fda1b0f31f01a969622
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15894
diff
changeset
|
30 | /* We can free the list here but the script needs to free the |
|
fa92350ed598
applied changes from 8d953d5714cb202c5fa66fda1b0f31f01a969622
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15894
diff
changeset
|
31 | * Purple::Status 'objects' itself. */ |
|
fa92350ed598
applied changes from 8d953d5714cb202c5fa66fda1b0f31f01a969622
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15894
diff
changeset
|
32 | g_list_free(ll); |
| 11118 | 33 | |
| 12792 | 34 | void |
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
35 | purple_prpl_got_account_idle(account, idle, idle_time) |
|
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
36 | Purple::Account account |
| 11118 | 37 | gboolean idle |
| 38 | time_t idle_time | |
| 39 | ||
| 12792 | 40 | void |
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
41 | purple_prpl_got_account_login_time(account, login_time) |
|
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
42 | Purple::Account account |
| 11118 | 43 | time_t login_time |
| 44 | ||
| 12792 | 45 | void |
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
46 | purple_prpl_got_user_idle(account, name, idle, idle_time) |
|
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
47 | Purple::Account account |
| 11118 | 48 | const char *name |
| 49 | gboolean idle | |
| 50 | time_t idle_time | |
| 51 | ||
| 12792 | 52 | void |
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
53 | purple_prpl_got_user_login_time(account, name, login_time) |
|
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
54 | Purple::Account account |
| 11118 | 55 | const char *name |
| 56 | time_t login_time | |
|
21959
a20e87ea2403
Add send_raw to Perl bindings. Patch from martijn. Fixes #3505
Sean Egan <seanegan@pidgin.im>
parents:
21737
diff
changeset
|
57 | |
|
a20e87ea2403
Add send_raw to Perl bindings. Patch from martijn. Fixes #3505
Sean Egan <seanegan@pidgin.im>
parents:
21737
diff
changeset
|
58 | int |
|
a20e87ea2403
Add send_raw to Perl bindings. Patch from martijn. Fixes #3505
Sean Egan <seanegan@pidgin.im>
parents:
21737
diff
changeset
|
59 | purple_prpl_send_raw(gc, str) |
|
a20e87ea2403
Add send_raw to Perl bindings. Patch from martijn. Fixes #3505
Sean Egan <seanegan@pidgin.im>
parents:
21737
diff
changeset
|
60 | Purple::Connection gc |
|
a20e87ea2403
Add send_raw to Perl bindings. Patch from martijn. Fixes #3505
Sean Egan <seanegan@pidgin.im>
parents:
21737
diff
changeset
|
61 | const char *str |
|
a20e87ea2403
Add send_raw to Perl bindings. Patch from martijn. Fixes #3505
Sean Egan <seanegan@pidgin.im>
parents:
21737
diff
changeset
|
62 | PREINIT: |
|
a20e87ea2403
Add send_raw to Perl bindings. Patch from martijn. Fixes #3505
Sean Egan <seanegan@pidgin.im>
parents:
21737
diff
changeset
|
63 | PurplePluginProtocolInfo *prpl_info; |
|
a20e87ea2403
Add send_raw to Perl bindings. Patch from martijn. Fixes #3505
Sean Egan <seanegan@pidgin.im>
parents:
21737
diff
changeset
|
64 | CODE: |
|
a20e87ea2403
Add send_raw to Perl bindings. Patch from martijn. Fixes #3505
Sean Egan <seanegan@pidgin.im>
parents:
21737
diff
changeset
|
65 | prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl); |
|
a20e87ea2403
Add send_raw to Perl bindings. Patch from martijn. Fixes #3505
Sean Egan <seanegan@pidgin.im>
parents:
21737
diff
changeset
|
66 | if (prpl_info && prpl_info->send_raw != NULL) { |
|
a20e87ea2403
Add send_raw to Perl bindings. Patch from martijn. Fixes #3505
Sean Egan <seanegan@pidgin.im>
parents:
21737
diff
changeset
|
67 | RETVAL = prpl_info->send_raw(gc, str, strlen(str)); |
|
a20e87ea2403
Add send_raw to Perl bindings. Patch from martijn. Fixes #3505
Sean Egan <seanegan@pidgin.im>
parents:
21737
diff
changeset
|
68 | } else { |
|
a20e87ea2403
Add send_raw to Perl bindings. Patch from martijn. Fixes #3505
Sean Egan <seanegan@pidgin.im>
parents:
21737
diff
changeset
|
69 | RETVAL = 0; |
|
a20e87ea2403
Add send_raw to Perl bindings. Patch from martijn. Fixes #3505
Sean Egan <seanegan@pidgin.im>
parents:
21737
diff
changeset
|
70 | } |
|
a20e87ea2403
Add send_raw to Perl bindings. Patch from martijn. Fixes #3505
Sean Egan <seanegan@pidgin.im>
parents:
21737
diff
changeset
|
71 | OUTPUT: |
|
a20e87ea2403
Add send_raw to Perl bindings. Patch from martijn. Fixes #3505
Sean Egan <seanegan@pidgin.im>
parents:
21737
diff
changeset
|
72 | RETVAL |
|
a20e87ea2403
Add send_raw to Perl bindings. Patch from martijn. Fixes #3505
Sean Egan <seanegan@pidgin.im>
parents:
21737
diff
changeset
|
73 |