Changeset 82dd923
- Timestamp:
- Mar 12, 2009, 11:38:04 PM (16 years ago)
- Branches:
- master, debian, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- 879e90dc
- Parents:
- e0fba58 (diff), 87dfeb7 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
perlconfig.c
re8c6d8f r87dfeb7 129 129 message2hashref and hashref2message. Currently we lose 130 130 zephyr-specific properties stored in the ZNotice_t 131 132 This has been somewhat addressed, but is still not lossless. 131 133 */ 132 134 owl_message * owl_perlconfig_hashref2message(SV *msg) … … 173 175 owl_message_set_attribute(m, "adminheader", ""); 174 176 } 177 #ifdef HAVE_LIBZEPHYR 178 if (owl_message_is_type_zephyr(m)) { 179 ZNotice_t *n = &(m->notice); 180 n->z_kind = ACKED; 181 n->z_port = 0; 182 n->z_auth = ZAUTH_NO; 183 n->z_checked_auth = 0; 184 n->z_class = owl_message_get_class(m); 185 n->z_class_inst = owl_message_get_instance(m); 186 n->z_opcode = owl_message_get_opcode(m); 187 n->z_sender = owl_message_get_sender(m); 188 n->z_recipient = owl_message_get_recipient(m); 189 n->z_default_format = "[zephyr created from perl]"; 190 n->z_multinotice = "[zephyr created from perl]"; 191 n->z_num_other_fields = 0; 192 n->z_message = owl_sprintf("%s%c%s", owl_message_get_zsig(m), '\0', owl_message_get_body(m)); 193 n->z_message_len = strlen(owl_message_get_zsig(m)) + strlen(owl_message_get_body(m)) + 1; 194 } 195 #endif 175 196 return m; 176 197 } -
Makefile.in
r1375a6a rf200413 79 79 modules_clean: 80 80 for i in $(MODULE_DIRS); do \ 81 cd $$i; test ! -f Makefile || make clean;\81 (cd $$i && (test ! -f Makefile || make clean)) \ 82 82 done 83 83 -
perl/modules/IRC/lib/BarnOwl/Module/IRC.pm
rf17bb2c0 re0fba58 147 147 148 148 BarnOwl::new_command( 149 'irc-msg' => mk_irc_command( \&cmd_msg , OPTIONAL_CHANNEL),149 'irc-msg' => mk_irc_command( \&cmd_msg ), 150 150 { 151 151 summary => 'Send an IRC message', … … 380 380 my $cmd = shift; 381 381 my $conn = shift; 382 my $to = shift || shift or die("Usage: $cmd NICK\n");382 my $to = shift or die("Usage: $cmd [NICK|CHANNEL]\n"); 383 383 # handle multiple recipients? 384 384 if(@_) { -
perlwrap.pm
r7743955 r19aeff4 1048 1048 my $sender = $m->long_sender; 1049 1049 $sender =~ s/\n.*$//s; 1050 return " (" . $sender . '@color[default]' . ")"; 1050 if (BarnOwl::getvar('colorztext') eq 'on') { 1051 return " (" . $sender . '@color[default]' . ")"; 1052 } else { 1053 return " ($sender)"; 1054 } 1051 1055 } 1052 1056 -
zephyr.c
r21882032 ra5e7ed6 8 8 9 9 static const char fileIdent[] = "$Id$"; 10 11 static GList *deferred_subs = NULL; 12 typedef struct _owl_sub_list { /* noproto */ 13 ZSubscription_t *subs; 14 int nsubs; 15 } owl_sub_list; 10 16 11 17 #ifdef HAVE_LIBZEPHYR … … 102 108 owl_zephyr_load_initial_subs(); 103 109 } 110 while(deferred_subs != NULL) { 111 owl_sub_list *subs = deferred_subs->data; 112 owl_function_debugmsg("Loading %d deferred subs.", subs->nsubs); 113 owl_zephyr_loadsubs_helper(subs->subs, subs->nsubs); 114 deferred_subs = g_list_delete_link(deferred_subs, deferred_subs); 115 owl_free(subs); 116 } 104 117 } 105 118 … … 178 191 int owl_zephyr_loadsubs_helper(ZSubscription_t subs[], int count) 179 192 { 180 int i, ret = 0; 181 /* sub without defaults */ 182 if (ZSubscribeToSansDefaults(subs,count,0) != ZERR_NONE) { 183 owl_function_error("Error subscribing to zephyr notifications."); 184 ret=-2; 185 } 186 187 /* free stuff */ 188 for (i=0; i<count; i++) { 189 owl_free(subs[i].zsub_class); 190 owl_free(subs[i].zsub_classinst); 191 owl_free(subs[i].zsub_recipient); 193 int ret; 194 if (owl_global_is_havezephyr(&g)) { 195 int i; 196 /* sub without defaults */ 197 if (ZSubscribeToSansDefaults(subs,count,0) != ZERR_NONE) { 198 owl_function_error("Error subscribing to zephyr notifications."); 199 ret=-2; 200 } 201 202 /* free stuff */ 203 for (i=0; i<count; i++) { 204 owl_free(subs[i].zsub_class); 205 owl_free(subs[i].zsub_classinst); 206 owl_free(subs[i].zsub_recipient); 207 } 208 209 owl_free(subs); 210 } else { 211 owl_sub_list *s = owl_malloc(sizeof(owl_sub_list)); 212 s->subs = subs; 213 s->nsubs = count; 214 deferred_subs = g_list_append(deferred_subs, s); 192 215 } 193 216 … … 242 265 243 266 if (count >= subSize) { 244 ZSubscription_t* newsubs; 245 newsubs = owl_realloc(subs, sizeof(ZSubscription_t) * subSize * 2); 246 if (NULL == newsubs) { 247 /* If realloc fails, load what we've got, clear, and continue */ 248 ret = owl_zephyr_loadsubs_helper(subs, count); 249 if (ret != 0) { 250 fclose(file); 251 return(ret); 252 } 253 count=0; 254 } 255 else { 256 subs = newsubs; 257 subSize *= 2; 258 } 267 subSize *= 2; 268 subs = owl_realloc(subs, sizeof(ZSubscription_t) * subSize); 259 269 } 260 270 … … 281 291 fclose(file); 282 292 283 ret=owl_zephyr_loadsubs_helper(subs, count); 284 owl_free(subs); 293 owl_zephyr_loadsubs_helper(subs, count); 285 294 return(ret); 286 295 #else … … 308 317 #ifdef HAVE_LIBZEPHYR 309 318 FILE *file; 310 ZSubscription_t subs[3001]; 319 ZSubscription_t *subs; 320 int numSubs = 100; 311 321 char subsfile[1024], buffer[1024]; 312 int count, ret , i;322 int count, ret; 313 323 struct stat statbuff; 324 325 subs = owl_malloc(numSubs * sizeof(ZSubscription_t)); 314 326 315 327 if (filename==NULL) { … … 325 337 326 338 ZResetAuthentication(); 327 /* need to redo this to do chunks, not just bag out after 3000 */328 339 count=0; 329 340 file=fopen(subsfile, "r"); … … 332 343 if (buffer[0]=='#' || buffer[0]=='\n' || buffer[0]=='\n') continue; 333 344 334 if (count >= 3000) break; /* also tell the user */ 345 if (count == numSubs) { 346 numSubs *= 2; 347 subs = owl_realloc(subs, numSubs * sizeof(ZSubscription_t)); 348 } 335 349 336 350 buffer[strlen(buffer)-1]='\0'; 337 subs[count].zsub_class= "login";338 subs[count].zsub_recipient= "*";351 subs[count].zsub_class=owl_strdup("login"); 352 subs[count].zsub_recipient=owl_strdup("*"); 339 353 if (strchr(buffer, '@')) { 340 354 subs[count].zsub_classinst=owl_strdup(buffer); 341 355 } else { 342 356 subs[count].zsub_classinst=owl_sprintf("%s@%s", buffer, ZGetRealm()); 343 357 } 344 358 … … 351 365 } 352 366 353 /* sub with defaults */ 354 if (ZSubscribeToSansDefaults(subs,count,0) != ZERR_NONE) { 355 owl_function_error("Error subscribing to zephyr notifications."); 356 ret=-2; 357 } 358 359 /* free stuff */ 360 for (i=0; i<count; i++) { 361 owl_free(subs[i].zsub_classinst); 362 } 363 367 ret = owl_zephyr_loadsubs_helper(subs, count); 364 368 return(ret); 365 369 #else
Note: See TracChangeset
for help on using the changeset viewer.