Changeset 3939268
- Timestamp:
- Dec 23, 2007, 3:16:26 PM (16 years ago)
- Branches:
- master, barnowl_perlaim, debian, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- 78667f3
- Parents:
- 8938188
- git-author:
- Alex Vandiver <alexmv@mit.edu> (12/23/07 15:15:33)
- git-committer:
- Alex Vandiver <alexmv@mit.edu> (12/23/07 15:16:26)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
functions.c
r27d8d83 r3939268 2060 2060 /* if it's a zephyr we sent, send it out the same way again */ 2061 2061 if (owl_message_is_direction_out(m)) { 2062 owl_function_zwrite_setup(owl_message_get_zwriteline(m)); 2063 owl_global_set_buffercommand(&g, owl_message_get_zwriteline(m)); 2064 return; 2062 buff = owl_strdup(owl_message_get_zwriteline(m)); 2063 } else { 2064 2065 /* Special case a personal reply to a webzephyr user on a class */ 2066 if ((type==1) && !strcasecmp(owl_message_get_opcode(m), OWL_WEBZEPHYR_OPCODE)) { 2067 class=OWL_WEBZEPHYR_CLASS; 2068 inst=owl_message_get_sender(m); 2069 to=OWL_WEBZEPHYR_PRINCIPAL; 2070 } else if (!strcasecmp(owl_message_get_class(m), OWL_WEBZEPHYR_CLASS) && owl_message_is_loginout(m)) { 2071 /* Special case LOGIN/LOGOUT notifications on class "webzephyr" */ 2072 class=OWL_WEBZEPHYR_CLASS; 2073 inst=owl_message_get_instance(m); 2074 to=OWL_WEBZEPHYR_PRINCIPAL; 2075 } else if (owl_message_is_loginout(m)) { 2076 /* Normal LOGIN/LOGOUT messages */ 2077 class="MESSAGE"; 2078 inst="PERSONAL"; 2079 to=owl_message_get_sender(m); 2080 } else if (type==1) { 2081 /* Personal reply */ 2082 class="MESSAGE"; 2083 inst="PERSONAL"; 2084 to=owl_message_get_sender(m); 2085 } else { 2086 /* General reply */ 2087 class=owl_message_get_class(m); 2088 inst=owl_message_get_instance(m); 2089 to=owl_message_get_recipient(m); 2090 cc=owl_message_get_cc_without_recipient(m); 2091 if (!strcmp(to, "") || !strcmp(to, "*")) { 2092 to=""; 2093 } else if (to[0]=='@') { 2094 /* leave it, to get the realm */ 2095 } else { 2096 to=owl_message_get_sender(m); 2097 } 2098 } 2099 2100 /* create the command line */ 2101 if (!strcasecmp(owl_message_get_opcode(m), "CRYPT")) { 2102 buff=owl_strdup("zcrypt"); 2103 } else { 2104 buff = owl_strdup("zwrite"); 2105 } 2106 if (strcasecmp(class, "message")) { 2107 buff = owl_sprintf("%s -c %s%s%s", oldbuff=buff, owl_getquoting(class), class, owl_getquoting(class)); 2108 owl_free(oldbuff); 2109 } 2110 if (strcasecmp(inst, "personal")) { 2111 buff = owl_sprintf("%s -i %s%s%s", oldbuff=buff, owl_getquoting(inst), inst, owl_getquoting(inst)); 2112 owl_free(oldbuff); 2113 } 2114 if (*to != '\0') { 2115 char *tmp, *oldtmp, *tmp2; 2116 tmp=short_zuser(to); 2117 if (cc) { 2118 tmp = owl_util_uniq(oldtmp=tmp, cc, "-"); 2119 owl_free(oldtmp); 2120 buff = owl_sprintf("%s -C %s", oldbuff=buff, tmp); 2121 owl_free(oldbuff); 2122 } else { 2123 if (owl_global_is_smartstrip(&g)) { 2124 tmp2=tmp; 2125 tmp=owl_zephyr_smartstripped_user(tmp2); 2126 owl_free(tmp2); 2127 } 2128 buff = owl_sprintf("%s %s", oldbuff=buff, tmp); 2129 owl_free(oldbuff); 2130 } 2131 owl_free(tmp); 2132 } 2133 if (cc) owl_free(cc); 2065 2134 } 2066 2067 /* Special case a personal reply to a webzephyr user on a class */2068 if ((type==1) && !strcasecmp(owl_message_get_opcode(m), OWL_WEBZEPHYR_OPCODE)) {2069 class=OWL_WEBZEPHYR_CLASS;2070 inst=owl_message_get_sender(m);2071 to=OWL_WEBZEPHYR_PRINCIPAL;2072 } else if (!strcasecmp(owl_message_get_class(m), OWL_WEBZEPHYR_CLASS) && owl_message_is_loginout(m)) {2073 /* Special case LOGIN/LOGOUT notifications on class "webzephyr" */2074 class=OWL_WEBZEPHYR_CLASS;2075 inst=owl_message_get_instance(m);2076 to=OWL_WEBZEPHYR_PRINCIPAL;2077 } else if (owl_message_is_loginout(m)) {2078 /* Normal LOGIN/LOGOUT messages */2079 class="MESSAGE";2080 inst="PERSONAL";2081 to=owl_message_get_sender(m);2082 } else if (type==1) {2083 /* Personal reply */2084 class="MESSAGE";2085 inst="PERSONAL";2086 to=owl_message_get_sender(m);2087 } else {2088 /* General reply */2089 class=owl_message_get_class(m);2090 inst=owl_message_get_instance(m);2091 to=owl_message_get_recipient(m);2092 cc=owl_message_get_cc_without_recipient(m);2093 if (!strcmp(to, "") || !strcmp(to, "*")) {2094 to="";2095 } else if (to[0]=='@') {2096 /* leave it, to get the realm */2097 } else {2098 to=owl_message_get_sender(m);2099 }2100 }2101 2102 /* create the command line */2103 if (!strcasecmp(owl_message_get_opcode(m), "CRYPT")) {2104 buff=owl_strdup("zcrypt");2105 } else {2106 buff = owl_strdup("zwrite");2107 }2108 if (strcasecmp(class, "message")) {2109 buff = owl_sprintf("%s -c %s%s%s", oldbuff=buff, owl_getquoting(class), class, owl_getquoting(class));2110 owl_free(oldbuff);2111 }2112 if (strcasecmp(inst, "personal")) {2113 buff = owl_sprintf("%s -i %s%s%s", oldbuff=buff, owl_getquoting(inst), inst, owl_getquoting(inst));2114 owl_free(oldbuff);2115 }2116 if (*to != '\0') {2117 char *tmp, *oldtmp, *tmp2;2118 tmp=short_zuser(to);2119 if (cc) {2120 tmp = owl_util_uniq(oldtmp=tmp, cc, "-");2121 owl_free(oldtmp);2122 buff = owl_sprintf("%s -C %s", oldbuff=buff, tmp);2123 owl_free(oldbuff);2124 } else {2125 if (owl_global_is_smartstrip(&g)) {2126 tmp2=tmp;2127 tmp=owl_zephyr_smartstripped_user(tmp2);2128 owl_free(tmp2);2129 }2130 buff = owl_sprintf("%s %s", oldbuff=buff, tmp);2131 owl_free(oldbuff);2132 }2133 owl_free(tmp);2134 }2135 if (cc) owl_free(cc);2136 2135 } else if (owl_message_is_type_aim(m)) { 2137 2136 /* aim */
Note: See TracChangeset
for help on using the changeset viewer.