- Timestamp:
- Jan 3, 2011, 8:20:52 PM (14 years ago)
- Branches:
- master, release-1.10, release-1.8, release-1.9
- Children:
- c23f678
- Parents:
- d222c44
- git-author:
- David Benjamin <davidben@mit.edu> (12/15/10 00:46:46)
- git-committer:
- David Benjamin <davidben@mit.edu> (01/03/11 20:20:52)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
zwrite.c
rd4582ef r719119de 390 390 if (z->zsig) owl_free(z->zsig); 391 391 } 392 393 /* 394 * Returns a zwrite line suitable for replying, specifically the 395 * message field is stripped out. Result should be freed with 396 * owl_free. 397 */ 398 char *owl_zwrite_get_replyline(const owl_zwrite *z) 399 { 400 /* Match ordering in zwrite help. */ 401 GString *buf = g_string_new(""); 402 int i; 403 404 /* Disturbingly, it is apparently possible to z->cmd to be null if 405 * owl_zwrite_create_from_line got something starting with -. And we 406 * can't kill it because this is exported to perl. */ 407 owl_string_append_quoted_arg(buf, z->cmd ? z->cmd : "zwrite"); 408 if (z->noping) { 409 g_string_append(buf, " -n"); 410 } 411 if (z->cc) { 412 g_string_append(buf, " -C"); 413 } 414 if (strcmp(z->class, "message")) { 415 g_string_append(buf, " -c "); 416 owl_string_append_quoted_arg(buf, z->class); 417 } 418 if (strcmp(z->inst, "personal")) { 419 g_string_append(buf, " -i "); 420 owl_string_append_quoted_arg(buf, z->inst); 421 } 422 if (z->realm && z->realm[0] != '\0') { 423 g_string_append(buf, " -r "); 424 owl_string_append_quoted_arg(buf, z->realm); 425 } 426 if (z->opcode && z->opcode[0] != '\0') { 427 g_string_append(buf, " -O "); 428 owl_string_append_quoted_arg(buf, z->opcode); 429 } 430 for (i = 0; i < owl_list_get_size(&(z->recips)); i++) { 431 g_string_append_c(buf, ' '); 432 owl_string_append_quoted_arg(buf, owl_list_get_element(&(z->recips), i)); 433 } 434 435 return g_string_free(buf, false); 436 }
Note: See TracChangeset
for help on using the changeset viewer.