Thu, 12 Feb 2009 06:00:15 +0000
Let XS do the argument checking/erroring for us for the components argument to
Purple::Serv::join_chat, we weren't doing any before.
Closes #8199.
| 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::Serv PACKAGE = Purple::Serv PREFIX = serv_ |
| 11118 | 4 | PROTOTYPES: ENABLE |
| 5 | ||
| 6 | ||
| 7 | void | |
| 8 | serv_add_deny(con, a) | |
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
9 | Purple::Connection con |
| 11118 | 10 | const char * a |
| 11 | ||
| 12 | void | |
| 13 | serv_add_permit(a, b) | |
|
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::Connection a |
| 11118 | 15 | const char * b |
| 16 | ||
| 17 | void | |
| 18 | serv_alias_buddy(buddy) | |
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
19 | Purple::BuddyList::Buddy buddy |
| 11118 | 20 | |
| 21 | void | |
| 22 | serv_chat_invite(con, a, b, c) | |
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
23 | Purple::Connection con |
| 11118 | 24 | int a |
| 25 | const char * b | |
| 26 | const char * c | |
| 27 | ||
| 28 | void | |
| 29 | serv_chat_leave(a, b) | |
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
30 | Purple::Connection a |
| 11118 | 31 | int b |
| 32 | ||
| 33 | int | |
|
12216
d80739091a63
[gaim-migrate @ 14518]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11975
diff
changeset
|
34 | serv_chat_send(con, a, b, flags) |
|
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::Connection con |
| 11118 | 36 | int a |
| 37 | const char * b | |
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
38 | Purple::MessageFlags flags |
| 11118 | 39 | |
| 40 | void | |
| 41 | serv_chat_whisper(con, a, b, c) | |
|
15894
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::Connection con |
| 11118 | 43 | int a |
| 44 | const char * b | |
| 45 | const char * c | |
| 46 | ||
| 47 | void | |
| 48 | serv_get_info(con, a) | |
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
49 | Purple::Connection con |
| 11118 | 50 | const char * a |
| 51 | ||
| 52 | void | |
| 53 | serv_got_alias(gc, who, alias) | |
|
15894
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::Connection gc |
| 11118 | 55 | const char *who |
| 56 | const char *alias | |
| 57 | ||
| 58 | void | |
| 59 | serv_got_chat_in(g, id, who, chatflags, message, mtime) | |
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
60 | Purple::Connection g |
| 11118 | 61 | int id |
| 62 | const char *who | |
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
63 | Purple::MessageFlags chatflags |
| 11118 | 64 | const char *message |
| 65 | time_t mtime | |
| 66 | ||
| 67 | void | |
| 68 | serv_got_chat_invite(gc, name, who, message, components) | |
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
69 | Purple::Connection gc |
| 11118 | 70 | const char *name |
| 71 | const char *who | |
| 72 | const char *message | |
| 73 | SV * components | |
| 74 | INIT: | |
| 75 | HV * t_HV; | |
| 76 | HE * t_HE; | |
| 77 | SV * t_SV; | |
| 78 | GHashTable * t_GHash; | |
| 79 | I32 len; | |
| 80 | char *t_key, *t_value; | |
| 81 | CODE: | |
| 82 | t_HV = (HV *)SvRV(components); | |
|
15203
1a092806f344
[gaim-migrate @ 17927]
Mark Doliner <markdoliner@pidgin.im>
parents:
15043
diff
changeset
|
83 | t_GHash = g_hash_table_new(g_str_hash, g_str_equal); |
| 11118 | 84 | |
| 85 | for (t_HE = hv_iternext(t_HV); t_HE != NULL; t_HE = hv_iternext(t_HV) ) { | |
| 86 | t_key = hv_iterkey(t_HE, &len); | |
| 87 | t_SV = *hv_fetch(t_HV, t_key, len, 0); | |
|
23980
a38cbb35eecf
Some cleanup and a couple leak fixes.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
88 | t_value = SvPVutf8_nolen(t_SV); |
| 11118 | 89 | |
| 90 | g_hash_table_insert(t_GHash, t_key, t_value); | |
| 91 | } | |
| 92 | serv_got_chat_invite(gc, name, who, message, t_GHash); | |
| 93 | ||
| 94 | void | |
| 95 | serv_got_chat_left(g, id) | |
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
96 | Purple::Connection g |
| 11118 | 97 | int id |
| 98 | ||
| 99 | void | |
| 100 | serv_got_im(gc, who, msg, imflags, mtime) | |
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
101 | Purple::Connection gc |
| 11118 | 102 | const char *who |
| 103 | const char *msg | |
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
104 | Purple::MessageFlags imflags |
| 11118 | 105 | time_t mtime |
| 106 | ||
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
107 | Purple::Conversation |
| 11118 | 108 | serv_got_joined_chat(gc, id, name) |
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
109 | Purple::Connection gc |
| 11118 | 110 | int id |
| 111 | const char *name | |
| 112 | ||
| 113 | void | |
| 114 | serv_got_typing(gc, name, timeout, state) | |
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
115 | Purple::Connection gc |
| 11118 | 116 | const char *name |
| 117 | int timeout | |
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
118 | Purple::TypingState state |
| 11118 | 119 | |
| 120 | void | |
| 121 | serv_got_typing_stopped(gc, name) | |
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
122 | Purple::Connection gc |
| 11118 | 123 | const char *name |
| 124 | ||
|
25590
5f663e07dfb7
Let XS do the argument checking/erroring for us for the components argument to
Etan Reisner <deryni@pidgin.im>
parents:
23980
diff
changeset
|
125 | void |
|
5f663e07dfb7
Let XS do the argument checking/erroring for us for the components argument to
Etan Reisner <deryni@pidgin.im>
parents:
23980
diff
changeset
|
126 | serv_join_chat(conn, components) |
|
5f663e07dfb7
Let XS do the argument checking/erroring for us for the components argument to
Etan Reisner <deryni@pidgin.im>
parents:
23980
diff
changeset
|
127 | Purple::Connection conn |
|
5f663e07dfb7
Let XS do the argument checking/erroring for us for the components argument to
Etan Reisner <deryni@pidgin.im>
parents:
23980
diff
changeset
|
128 | HV * components |
|
5f663e07dfb7
Let XS do the argument checking/erroring for us for the components argument to
Etan Reisner <deryni@pidgin.im>
parents:
23980
diff
changeset
|
129 | PREINIT: |
|
5f663e07dfb7
Let XS do the argument checking/erroring for us for the components argument to
Etan Reisner <deryni@pidgin.im>
parents:
23980
diff
changeset
|
130 | HE *t_HE; |
|
5f663e07dfb7
Let XS do the argument checking/erroring for us for the components argument to
Etan Reisner <deryni@pidgin.im>
parents:
23980
diff
changeset
|
131 | SV *t_SV; |
| 11118 | 132 | I32 len; |
|
25590
5f663e07dfb7
Let XS do the argument checking/erroring for us for the components argument to
Etan Reisner <deryni@pidgin.im>
parents:
23980
diff
changeset
|
133 | GHashTable *t_GHash; |
| 11118 | 134 | char *t_key, *t_value; |
| 135 | CODE: | |
|
15203
1a092806f344
[gaim-migrate @ 17927]
Mark Doliner <markdoliner@pidgin.im>
parents:
15043
diff
changeset
|
136 | t_GHash = g_hash_table_new(g_str_hash, g_str_equal); |
| 11118 | 137 | |
|
25590
5f663e07dfb7
Let XS do the argument checking/erroring for us for the components argument to
Etan Reisner <deryni@pidgin.im>
parents:
23980
diff
changeset
|
138 | for (t_HE = hv_iternext(components); t_HE != NULL; |
|
5f663e07dfb7
Let XS do the argument checking/erroring for us for the components argument to
Etan Reisner <deryni@pidgin.im>
parents:
23980
diff
changeset
|
139 | t_HE = hv_iternext(components)) { |
| 11118 | 140 | t_key = hv_iterkey(t_HE, &len); |
|
25590
5f663e07dfb7
Let XS do the argument checking/erroring for us for the components argument to
Etan Reisner <deryni@pidgin.im>
parents:
23980
diff
changeset
|
141 | t_SV = *hv_fetch(components, t_key, len, 0); |
|
5f663e07dfb7
Let XS do the argument checking/erroring for us for the components argument to
Etan Reisner <deryni@pidgin.im>
parents:
23980
diff
changeset
|
142 | t_value = SvPVutf8_nolen(t_SV); |
| 11118 | 143 | |
| 144 | g_hash_table_insert(t_GHash, t_key, t_value); | |
| 145 | } | |
|
25590
5f663e07dfb7
Let XS do the argument checking/erroring for us for the components argument to
Etan Reisner <deryni@pidgin.im>
parents:
23980
diff
changeset
|
146 | serv_join_chat(conn, t_GHash); |
| 11118 | 147 | |
| 148 | void | |
| 149 | serv_move_buddy(buddy, group1, group2) | |
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
150 | Purple::BuddyList::Buddy buddy |
|
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
151 | Purple::BuddyList::Group group1 |
|
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
152 | Purple::BuddyList::Group group2 |
| 11118 | 153 | |
| 154 | void | |
| 155 | serv_reject_chat(con, components) | |
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
156 | Purple::Connection con |
| 11118 | 157 | SV * components |
| 158 | INIT: | |
| 159 | HV * t_HV; | |
| 160 | HE * t_HE; | |
| 161 | SV * t_SV; | |
| 162 | GHashTable * t_GHash; | |
| 163 | I32 len; | |
| 164 | char *t_key, *t_value; | |
| 165 | CODE: | |
| 166 | t_HV = (HV *)SvRV(components); | |
|
15203
1a092806f344
[gaim-migrate @ 17927]
Mark Doliner <markdoliner@pidgin.im>
parents:
15043
diff
changeset
|
167 | t_GHash = g_hash_table_new(g_str_hash, g_str_equal); |
| 11118 | 168 | |
| 169 | for (t_HE = hv_iternext(t_HV); t_HE != NULL; t_HE = hv_iternext(t_HV) ) { | |
| 170 | t_key = hv_iterkey(t_HE, &len); | |
| 171 | t_SV = *hv_fetch(t_HV, t_key, len, 0); | |
|
23980
a38cbb35eecf
Some cleanup and a couple leak fixes.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
172 | t_value = SvPVutf8_nolen(t_SV); |
| 11118 | 173 | |
| 174 | g_hash_table_insert(t_GHash, t_key, t_value); | |
| 175 | } | |
| 176 | serv_reject_chat(con, t_GHash); | |
| 177 | ||
| 178 | void | |
| 179 | serv_rem_deny(con, a) | |
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
180 | Purple::Connection con |
| 11118 | 181 | const char * a |
| 182 | ||
| 183 | void | |
| 184 | serv_rem_permit(con, a) | |
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
185 | Purple::Connection con |
|
11643
f04408721780
[gaim-migrate @ 13920]
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
11290
diff
changeset
|
186 | const char * a |
| 11118 | 187 | |
| 188 | void | |
| 189 | serv_send_file(gc, who, file) | |
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
190 | Purple::Connection gc |
| 11118 | 191 | const char *who |
| 192 | const char *file | |
| 193 | ||
| 194 | int | |
| 195 | serv_send_im(con, a, b, flags ) | |
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
196 | Purple::Connection con |
| 11118 | 197 | const char * a |
| 198 | const char * b | |
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
199 | Purple::MessageFlags flags |
| 11118 | 200 | |
| 201 | int | |
|
13844
835b8f7b3d1d
[gaim-migrate @ 16295]
Mark Doliner <markdoliner@pidgin.im>
parents:
12216
diff
changeset
|
202 | serv_send_typing(con, a, state) |
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
203 | Purple::Connection con |
| 11118 | 204 | const char * a |
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
205 | Purple::TypingState state |
| 11118 | 206 | |
| 207 | void | |
| 208 | serv_set_info(con, a) | |
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
209 | Purple::Connection con |
| 11118 | 210 | const char * a |
| 211 | ||
| 212 | void | |
| 213 | serv_set_permit_deny(con) | |
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
214 | Purple::Connection con |
| 11118 | 215 |