diff libpurple/protocols/zephyr/zephyr.c @ 31534:a8cc50c2279f

Remove trailing whitespace
author Richard Laager <rlaager@wiktel.com>
date Tue, 04 Jan 2011 06:55:30 +0000
parents 2a436e0ce977
children ef2f89a2c25d
line wrap: on
line diff
--- a/libpurple/protocols/zephyr/zephyr.c	Tue Jan 04 06:42:45 2011 +0000
+++ b/libpurple/protocols/zephyr/zephyr.c	Tue Jan 04 06:55:30 2011 +0000
@@ -9,7 +9,7 @@
  *
  * Some code borrowed from kzephyr, by
  * Chris Colohan <colohan+@cs.cmu.edu>
- * 
+ *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
@@ -98,9 +98,9 @@
 	int num_children;
 };
 
-parse_tree null_parse_tree = { 
-	"", 
-	{NULL}, 
+parse_tree null_parse_tree = {
+	"",
+	{NULL},
 	0,
 };
 
@@ -175,7 +175,7 @@
 			ZSubscription_t sub;
 			sub.zsub_class = class;
 			sub.zsub_classinst = instance;
-			sub.zsub_recipient = recipient; 
+			sub.zsub_recipient = recipient;
 			ret_val = ZSubscribeTo(&sub,1,0);
 		}
 	}
@@ -188,7 +188,7 @@
 
 static char *zephyr_strip_local_realm(zephyr_account* zephyr,const char* user){
 	/*
-	  Takes in a username of the form username or username@realm 
+	  Takes in a username of the form username or username@realm
 	  and returns:
 	  username, if there is no realm, or the realm is the local realm
 	  or:
@@ -255,9 +255,9 @@
 /* returns true if zt1 is a subset of zt2.  This function is used to
    determine whether a zephyr sent to zt1 should be placed in the chat
    with triple zt2
- 
-   zt1 is a subset of zt2 
-   iff. the classnames are identical ignoring case 
+
+   zt1 is a subset of zt2
+   iff. the classnames are identical ignoring case
    AND. the instance names are identical (ignoring case), or zt2->instance is *.
    AND. the recipient names are identical
 */
@@ -266,7 +266,7 @@
 {
 
 	if (!zt2) {
-		purple_debug_error("zephyr","zt2 doesn't exist\n"); 
+		purple_debug_error("zephyr","zt2 doesn't exist\n");
 		return FALSE;
 	}
 	if (!zt1) {
@@ -339,7 +339,7 @@
 	return NULL;
 }
 
-/* 
+/*
    Converts strings to utf-8 if necessary using user specified encoding
 */
 
@@ -362,7 +362,7 @@
 	}
 }
 
-/* This parses HTML formatting (put out by one of the gtkimhtml widgets 
+/* This parses HTML formatting (put out by one of the gtkimhtml widgets
    And converts it to zephyr formatting.
    It currently deals properly with <b>, <br>, <i>, <font face=...>, <font color=...>,
    It ignores <font back=...>
@@ -801,19 +801,19 @@
 				}
 				for (; nlocs > 0; nlocs--) {
 					/* XXX add real error reporting */
-					
+
 					ZGetLocations(&locs, &one);
-					tmp = g_strdup_printf(_("<br>At %s since %s"), locs.host, locs.time);	
+					tmp = g_strdup_printf(_("<br>At %s since %s"), locs.host, locs.time);
 					purple_notify_user_info_add_pair(user_info, _("Location"), tmp);
 					g_free(tmp);
 				}
-				purple_notify_userinfo(gc, (b ? bname : user), 
+				purple_notify_userinfo(gc, (b ? bname : user),
 						     user_info, NULL, NULL);
 				purple_notify_user_info_destroy(user_info);
 			} else {
-				if (nlocs>0) 
+				if (nlocs>0)
 					purple_prpl_got_user_status(gc->account, b ? bname : user, "available", NULL);
-				else 
+				else
 					purple_prpl_got_user_status(gc->account, b ? bname : user, "offline", NULL);
 			}
 
@@ -825,7 +825,7 @@
 		PurpleConversation *gconv1;
 		PurpleConvChat *gcc;
 		char *ptr = (char *) notice.z_message + (strlen(notice.z_message) + 1);
-		int len; 
+		int len;
 		char *stripped_sender;
 		int signature_length = strlen(notice.z_message);
 		int message_has_no_body = 0;
@@ -839,7 +839,7 @@
 			len = 0;
 			purple_debug_info("zephyr","message_size %d %d %d\n",len,notice.z_message_len,signature_length);
 			buf3 = g_strdup("");
-						
+
 		} else {
 			len =  notice.z_message_len - ( signature_length +1);
 			purple_debug_info("zephyr","message_size %d %d %d\n",len,notice.z_message_len,signature_length);
@@ -856,11 +856,11 @@
 
 		stripped_sender = zephyr_strip_local_realm(zephyr,notice.z_sender);
 
-		if (!g_ascii_strcasecmp(notice.z_class, "MESSAGE") && !g_ascii_strcasecmp(notice.z_class_inst, "PERSONAL") 
+		if (!g_ascii_strcasecmp(notice.z_class, "MESSAGE") && !g_ascii_strcasecmp(notice.z_class_inst, "PERSONAL")
 		    && !g_ascii_strcasecmp(notice.z_recipient,zephyr->username)) {
 			if (!g_ascii_strcasecmp(notice.z_message, "Automated reply:"))
 				flags |= PURPLE_MESSAGE_AUTO_RESP;
-			
+
 			if (!g_ascii_strcasecmp(notice.z_opcode,"PING"))
 				serv_got_typing(gc,stripped_sender,ZEPHYR_TYPING_RECV_TIMEOUT, PURPLE_TYPING);
 			else
@@ -876,8 +876,8 @@
 				/* This is a server supplied subscription */
 				zephyr->subscrips = g_slist_append(zephyr->subscrips, new_triple(zephyr,zt1->class,zt1->instance,zt1->recipient));
 				zt2 = find_sub_by_triple(gc->proto_data,zt1);
-			} 
-					
+			}
+
 			if (!zt2->open) {
 				zt2->open = TRUE;
 				serv_got_joined_chat(gc, zt2->id, zt2->name);
@@ -936,7 +936,7 @@
 			}
 		}
 		if ((tree != &null_parse_tree) && (tree->contents != NULL))
-			g_free(tree->contents);	  
+			g_free(tree->contents);
 
 	}
 	return 0;
@@ -954,7 +954,7 @@
 {
 	gchar* tc;
 
-	if (!ptree || ! key) 
+	if (!ptree || ! key)
 		return &null_parse_tree;
 
 	tc = tree_child(ptree,0)->contents;
@@ -976,7 +976,7 @@
 }
 
 static parse_tree *parse_buffer(gchar* source, gboolean do_parse) {
-	
+
 	parse_tree *ptree = g_new0(parse_tree,1);
 	ptree->contents = NULL;
 	ptree->num_children=0;
@@ -991,7 +991,7 @@
 				p++;
 				continue;
 			}
-			
+
 			/* Skip comments */
 			if(source[p] == ';') {
 				while(source[p] != '\n' && p < strlen(source)) {
@@ -999,7 +999,7 @@
 				}
 				continue;
 			}
-			
+
 			if(source[p] == '(') {
 				int nesting = 0;
 				gboolean in_quote = FALSE;
@@ -1036,12 +1036,12 @@
 					p++;
 				} else {
 					end_char = ' ';
-				}					      
+				}
 				do_parse = FALSE;
 
 				end = p;
 				while(source[end] != end_char && end < strlen(source)) {
-					if(source[end] == '\\') 
+					if(source[end] == '\\')
 						end++;
 					end++;
 				}
@@ -1136,16 +1136,16 @@
 				/*				  g_free(zsig); */
 				g_free(buf);
 				/* free_parse_tree(msgnode);
-				   free_parse_tree(bodynode); 
+				   free_parse_tree(bodynode);
 				   g_free(msg);
 				   g_free(zsig);
-				   g_free(buf); 
+				   g_free(buf);
 				*/
 			}
 			else if (!g_ascii_strncasecmp(spewtype,"zlocation",9)) {
 				/* check_loc or zephyr_zloc respectively */
 				/* XXX fix */
-				char *user; 
+				char *user;
 				PurpleBuddy *b;
 				const char *bname;
 				int nlocs = 0;
@@ -1166,7 +1166,7 @@
 				} else {
 					nlocs = 1;
 				}
-	
+
 				bname = b ? purple_buddy_get_name(b) : NULL;
 				if ((b && pending_zloc(zephyr,bname)) || pending_zloc(zephyr,user) || pending_zloc(zephyr,local_zephyr_normalize(zephyr,user))){
 					PurpleNotifyUserInfo *user_info = purple_notify_user_info_new();
@@ -1193,9 +1193,9 @@
 							     user_info, NULL, NULL);
 					purple_notify_user_info_destroy(user_info);
 				} else {
-					if (nlocs>0) 
+					if (nlocs>0)
 						purple_prpl_got_user_status(gc->account, b ? bname : user, "available", NULL);
-					else 
+					else
 						purple_prpl_got_user_status(gc->account, b ? bname : user, "offline", NULL);
 				}
 			}
@@ -1210,7 +1210,7 @@
 		}
 	} else {
 	}
-	
+
 	free_parse_tree(newparsetree);
 	return TRUE;
 }
@@ -1319,9 +1319,9 @@
 				int i;
 				for(i=0;i<numlocs;i++) {
 					ZGetLocations(&locations,&one);
-					if (nlocs>0) 
+					if (nlocs>0)
 						purple_prpl_got_user_status(account,name,"available",NULL);
-					else 
+					else
 						purple_prpl_got_user_status(account,name,"offline",NULL);
 				}
 			}
@@ -1330,7 +1330,7 @@
 			g_free(ald.user);
 			g_free(ald.version);
 #endif /* WIN32 */
-		} else 
+		} else
 			if (use_tzc(zephyr)) {
 				gchar *zlocstr = g_strdup_printf("((tzcfodder . zlocate) \"%s\")\n",chk);
 				size_t len = strlen(zlocstr);
@@ -1381,14 +1381,14 @@
 {
 	/* XXX This code may not be Win32 clean */
 	struct hostent *hent;
-	
+
 	if (gethostname(zephyr->ourhost, sizeof(zephyr->ourhost)) == -1) {
 		purple_debug_error("zephyr", "unable to retrieve hostname, %%host%% and %%canon%% will be wrong in subscriptions and have been set to unknown\n");
 		g_strlcpy(zephyr->ourhost, "unknown", sizeof(zephyr->ourhost));
 		g_strlcpy(zephyr->ourhostcanon, "unknown", sizeof(zephyr->ourhostcanon));
 		return;
 	}
-	
+
 	if (!(hent = gethostbyname(zephyr->ourhost))) {
 		purple_debug_error("zephyr", "unable to resolve hostname, %%canon%% will be wrong in subscriptions.and has been set to the value of %%host%%, %s\n",zephyr->ourhost);
 		g_strlcpy(zephyr->ourhostcanon, zephyr->ourhost, sizeof(zephyr->ourhostcanon));
@@ -1402,7 +1402,7 @@
 
 static void process_zsubs(zephyr_account *zephyr)
 {
-	/* Loads zephyr chats "(subscriptions) from ~/.zephyr.subs, and 
+	/* Loads zephyr chats "(subscriptions) from ~/.zephyr.subs, and
 	   registers (subscribes to) them on the server */
 
 	/* XXX deal with unsubscriptions */
@@ -1467,7 +1467,7 @@
 					} else {
 						z_class = g_strdup(triple[0]);
 					}
-					
+
 					if (!g_ascii_strcasecmp(triple[1],"%host%")) {
 						z_instance = g_strdup(zephyr->ourhost);
 					} else if (!g_ascii_strcasecmp(triple[1],"%canon%")) {
@@ -1520,7 +1520,7 @@
 					if (!(b = purple_find_buddy(gc->account,stripped_user))){
 						b = purple_buddy_new(gc->account, stripped_user, NULL);
 						purple_blist_add_buddy(b, NULL, g, NULL);
-					} 
+					}
 					g_free(stripped_user);
 				}
 			}
@@ -1552,20 +1552,20 @@
 {
 	PurpleConnection *gc;
 	zephyr_account *zephyr;
-	gboolean read_anyone; 
-	gboolean read_zsubs; 
+	gboolean read_anyone;
+	gboolean read_zsubs;
 	gchar *exposure;
 
 	gc = purple_account_get_connection(account);
 	read_anyone = purple_account_get_bool(gc->account,"read_anyone",TRUE);
 	read_zsubs = purple_account_get_bool(gc->account,"read_zsubs",TRUE);
-	exposure = (gchar *)purple_account_get_string(gc->account, "exposure_level", EXPOSE_REALMVIS); 
+	exposure = (gchar *)purple_account_get_string(gc->account, "exposure_level", EXPOSE_REALMVIS);
 
 #ifdef WIN32
 	username = purple_account_get_username(account);
 #endif
 	gc->flags |= PURPLE_CONNECTION_AUTO_RESP | PURPLE_CONNECTION_HTML | PURPLE_CONNECTION_NO_BGCOLOR | PURPLE_CONNECTION_NO_URLDESC;
-	gc->proto_data = zephyr=g_new0(zephyr_account,1); 
+	gc->proto_data = zephyr=g_new0(zephyr_account,1);
 
 	zephyr->account = account;
 
@@ -1589,9 +1589,9 @@
 			purple_debug_error("zephyr", "pipe creation failed. killing\n");
 			exit(-1);
 		}
-		
+
 		pid = fork();
-		
+
 		if (pid == -1) {
 			purple_debug_error("zephyr", "forking failed\n");
 			exit(-1);
@@ -1618,10 +1618,10 @@
 			if (close(zephyr->totzc[0]) == -1) {
 				exit(-1);
 			}
-			/* tzc_command should really be of the form 
+			/* tzc_command should really be of the form
 			   path/to/tzc -e %s
 			   or
-			   ssh username@hostname pathtotzc -e %s 
+			   ssh username@hostname pathtotzc -e %s
 			   -- this should not require a password, and ideally should be kerberized ssh --
 			   or
 			   fsh username@hostname pathtotzc -e %s
@@ -1631,7 +1631,7 @@
 					/*					fprintf(stderr,"replacing %%s with %s\n",zephyr->exposure); */
 					tzc_cmd_array[i] = g_strdup(zephyr->exposure);
 					found_ps = TRUE;
-					
+
 				} else {
 					/*					fprintf(stderr,"keeping %s\n",tzc_cmd_array[i]); */
 				}
@@ -1712,24 +1712,24 @@
 
 			while(ptr < bufcur) {
 				if (*ptr == '(') {
-					parenlevel++; 
+					parenlevel++;
 				}
 				else if (*ptr == ')') {
 					parenlevel--;
 				}
 				purple_debug_info("zephyr","tzc parenlevel is %d\n",parenlevel);
 				switch (parenlevel) {
-				case 0: 
+				case 0:
 					break;
 				case 1:
 					/* Search for next beginning (, or for the ending */
 					ptr++;
-					while((*ptr != '(') && (*ptr != ')') && (ptr <bufcur)) 
+					while((*ptr != '(') && (*ptr != ')') && (ptr <bufcur))
 						ptr++;
-					if (ptr >= bufcur) 
+					if (ptr >= bufcur)
 						purple_debug_error("zephyr","tzc parsing error\n");
 					break;
-				case 2: 
+				case 2:
 					/* You are probably at
 					   (foo . bar ) or (foo . "bar") or (foo . chars) or (foo . numbers) or (foo . () )
 					   Parse all the data between the first and last f, and move past )
@@ -1749,9 +1749,9 @@
 						}
 					}
 					purple_debug_info("zephyr","tempstr parsed\n");
-					/* tempstr should now be a tempstridx length string containing all characters 
+					/* tempstr should now be a tempstridx length string containing all characters
 					   from that after the first ( to the one before the last paren ). */
-					/* We should have the following possible lisp strings but we don't care 
+					/* We should have the following possible lisp strings but we don't care
 					   (tzcspew . start) (version . "something") (pid . number)*/
 					/* We care about 'zephyrid . "username@REALM.NAME"' and 'exposure . "SOMETHING"' */
 					tempstridx=0;
@@ -1766,9 +1766,9 @@
 						tempstridx++;
 						while(tempstr[tempstridx] !='"' && tempstridx < 20000)
 							username[username_idx++]=tempstr[tempstridx++];
-							
+
 						zephyr->username = g_strdup_printf("%s",username);
-						if ((realm = strchr(username,'@'))) 
+						if ((realm = strchr(username,'@')))
 							zephyr->realm = g_strdup_printf("%s",realm+1);
 						else {
 							realm = (gchar *)purple_account_get_string(gc->account,"realm","");
@@ -1781,12 +1781,12 @@
 						/* else {
 						   zephyr->realm = g_strdup("local-realm");
 						   }*/
-							
+
 						g_free(username);
 					}  else {
 						purple_debug_info("zephyr", "something that's not zephyr id found %s\n",tempstr);
 					}
-					
+
 					/* We don't care about anything else yet */
 					g_free(tempstr);
 					break;
@@ -1850,8 +1850,8 @@
 		zephyr->nottimer = purple_timeout_add(100, check_notify_zeph02, gc);
 	} else if (use_tzc(zephyr)) {
 		zephyr->nottimer = purple_timeout_add(100, check_notify_tzc, gc);
-	} 
-	zephyr->loctimer = purple_timeout_add_seconds(20, check_loc, gc); 
+	}
+	zephyr->loctimer = purple_timeout_add_seconds(20, check_loc, gc);
 
 }
 
@@ -1881,7 +1881,7 @@
 		char *zclass, *zinst, *zrecip;
 		zt = s->data;
 		triple = g_strsplit(zt->name, ",", 3);
-		
+
 		/* deal with classes */
 		if (!g_ascii_strcasecmp(triple[0],zephyr->ourhost)) {
 			zclass = g_strdup("%host%");
@@ -1913,7 +1913,7 @@
 		}
 
 		fprintf(fd, "%s,%s,%s\n",zclass,zinst,zrecip);
-		 
+
 		g_free(zclass);
 		g_free(zinst);
 		g_free(zrecip);
@@ -1995,7 +1995,7 @@
 			int err=errno;
 			if (err==EINVAL) {
 				purple_debug_error("zephyr","An invalid signal was specified when killing tzc\n");
-			} 
+			}
 			else if (err==ESRCH) {
 				purple_debug_error("zephyr","Tzc's pid didn't exist while killing tzc\n");
 			}
@@ -2009,7 +2009,7 @@
 	}
 }
 
-static int zephyr_send_message(zephyr_account *zephyr,char* zclass, char* instance, char* recipient, const char *im, 
+static int zephyr_send_message(zephyr_account *zephyr,char* zclass, char* instance, char* recipient, const char *im,
 			       const char *sig, char *opcode) ;
 
 static const char * zephyr_get_signature(void)
@@ -2067,7 +2067,7 @@
 	}
 	zephyr_send_message(zephyr,"MESSAGE","PERSONAL",local_zephyr_normalize(zephyr,who),im,sig,"");
 
-	return 1; 
+	return 1;
 }
 
 /* Munge the outgoing zephyr so that any quotes or backslashes are
@@ -2091,7 +2091,7 @@
 				newmsg[pos2]='\\';
 				newmsg[pos2+1]='"';
 				pos2+=2;
-			} 
+			}
 			else {
 				newmsg[pos2] = message[pos];
 				pos2++;
@@ -2128,13 +2128,13 @@
 	return newmsg;
 }
 
-static int zephyr_send_message(zephyr_account *zephyr,char* zclass, char* instance, char* recipient, const char *im, 
-			       const char *sig, char *opcode) 
+static int zephyr_send_message(zephyr_account *zephyr,char* zclass, char* instance, char* recipient, const char *im,
+			       const char *sig, char *opcode)
 {
 
-	/* (From the tzc source) 
+	/* (From the tzc source)
 	 * emacs sends something of the form:
-	 * ((class . "MESSAGE") 
+	 * ((class . "MESSAGE")
 	 *  (auth . t)
 	 *  (recipients ("PERSONAL" . "bovik") ("test" . ""))
 	 *  (sender . "bovik")
@@ -2169,7 +2169,7 @@
 		ZNotice_t notice;
 		char *buf = g_strdup_printf("%s%c%s", sig, '\0', html_buf2);
 		memset((char *)&notice, 0, sizeof(notice));
-		
+
 		notice.z_kind = ACKED;
 		notice.z_port = 0;
 		notice.z_opcode = "";
@@ -2201,11 +2201,11 @@
 
 char *local_zephyr_normalize(zephyr_account *zephyr,const char *orig)
 {
-	/* 
-	   Basically the inverse of zephyr_strip_local_realm 
-	*/	
+	/*
+	   Basically the inverse of zephyr_strip_local_realm
+	*/
 	char* buf;
-	
+
 	if (!g_ascii_strcasecmp(orig, "")) {
 		return g_strdup("");
 	}
@@ -2214,7 +2214,7 @@
 		buf = g_strdup_printf("%s",orig);
 	} else {
 		buf = g_strdup_printf("%s@%s",orig,zephyr->realm);
-	} 
+	}
 	return buf;
 }
 
@@ -2281,7 +2281,7 @@
 
 	if (primitive == PURPLE_STATUS_AWAY) {
 		zephyr->away = g_strdup(purple_status_get_attr_string(status,"message"));
-	} 
+	}
 	else if (primitive == PURPLE_STATUS_AVAILABLE) {
 		if (use_zeph02(zephyr)) {
 			ZSetLocation(zephyr->exposure);
@@ -2295,7 +2295,7 @@
 			}
 			g_free(zexpstr);
 		}
-	} 
+	}
 	else if (primitive == PURPLE_STATUS_INVISIBLE) {
 		/* XXX handle errors */
 		if (use_zeph02(zephyr)) {
@@ -2312,12 +2312,12 @@
 	}
 }
 
-static GList *zephyr_status_types(PurpleAccount *account) 
+static GList *zephyr_status_types(PurpleAccount *account)
 {
 	PurpleStatusType *type;
 	GList *types = NULL;
 
-	/* zephyr has several exposures 
+	/* zephyr has several exposures
 	   NONE (where you are hidden, and zephyrs to you are in practice silently dropped -- yes this is wrong)
 	   OPSTAFF "hidden"
 	   REALM-VISIBLE visible to people in local realm
@@ -2410,13 +2410,13 @@
 	instname = g_hash_table_lookup(data, "instance");
 	recip = g_hash_table_lookup(data, "recipient");
 
-		
+
 	if (!classname)
 		return;
 
 	if (!g_ascii_strcasecmp(classname,"%host%"))
 		classname = g_strdup(zephyr->ourhost);
-	if (!g_ascii_strcasecmp(classname,"%canon%")) 
+	if (!g_ascii_strcasecmp(classname,"%canon%"))
 		classname = g_strdup(zephyr->ourhostcanon);
 
 	if (!instname || !strlen(instname))
@@ -2424,7 +2424,7 @@
 
 	if (!g_ascii_strcasecmp(instname,"%host%"))
 		instname = g_strdup(zephyr->ourhost);
-	if (!g_ascii_strcasecmp(instname,"%canon%")) 
+	if (!g_ascii_strcasecmp(instname,"%canon%"))
 		instname = g_strdup(zephyr->ourhostcanon);
 
 	if (!recip || (*recip == '*'))
@@ -2437,15 +2437,15 @@
 	if (zt2) {
 		free_triple(zt1);
 		if (!zt2->open) {
-			if (!g_ascii_strcasecmp(instname,"*")) 
+			if (!g_ascii_strcasecmp(instname,"*"))
 				instname = "PERSONAL";
 			serv_got_joined_chat(gc, zt2->id, zt2->name);
 			zephyr_chat_set_topic(gc,zt2->id,instname);
 			zt2->open = TRUE;
-		}	
+		}
 		return;
 	}
-	
+
 	/*	sub.zsub_class = zt1->class;
 		sub.zsub_classinst = zt1->instance;
 		sub.zsub_recipient = zt1->recipient; */
@@ -2460,7 +2460,7 @@
 	zephyr->subscrips = g_slist_append(zephyr->subscrips, zt1);
 	zt1->open = TRUE;
 	serv_got_joined_chat(gc, zt1->id, zt1->name);
-	if (!g_ascii_strcasecmp(instname,"*")) 
+	if (!g_ascii_strcasecmp(instname,"*"))
 		instname = "PERSONAL";
 	zephyr_chat_set_topic(gc,zt1->id,instname);
 }
@@ -2519,7 +2519,7 @@
 static unsigned int zephyr_send_typing(PurpleConnection *gc, const char *who, PurpleTypingState state) {
 	gchar *recipient;
 	zephyr_account *zephyr = gc->proto_data;
-	if (use_tzc(zephyr)) 
+	if (use_tzc(zephyr))
 		return 0;
 
 	if (state == PURPLE_NOT_TYPING)
@@ -2565,7 +2565,7 @@
 
 	zt = find_sub_by_id(gc->proto_data,id);
 	/* find_sub_by_id can return NULL */
-	if (!zt) 
+	if (!zt)
 		return;
 	gconv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_CHAT, zt->name,
 												gc->account);
@@ -2586,7 +2586,7 @@
 	zephyr_account *zephyr = purple_conversation_get_gc(conv)->proto_data;
 	if (!g_ascii_strcasecmp(args[0],"*"))
 		return PURPLE_CMD_RET_FAILED;  /* "*" is not a valid argument */
-	else 
+	else
 		recipient = local_zephyr_normalize(zephyr,args[0]);
 
 	if (strlen(recipient) < 1)
@@ -2594,7 +2594,7 @@
 
 	if (zephyr_send_message(zephyr,"MESSAGE","PERSONAL",recipient,args[1],zephyr_get_signature(),""))
 		return PURPLE_CMD_RET_OK;
-	else 
+	else
 		return PURPLE_CMD_RET_FAILED;
 }
 
@@ -2638,7 +2638,7 @@
 	zephyr_account *zephyr = purple_conversation_get_gc(conv)->proto_data;
 	if ( zephyr_send_message(zephyr,"message",args[0],"",args[1],zephyr_get_signature(),""))
 		return PURPLE_CMD_RET_OK;
-	else 
+	else
 		return PURPLE_CMD_RET_FAILED;
 }
 
@@ -2649,7 +2649,7 @@
 	zephyr_account *zephyr = purple_conversation_get_gc(conv)->proto_data;
 	if ( zephyr_send_message(zephyr,args[0],args[1],"",args[2],zephyr_get_signature(),""))
 		return PURPLE_CMD_RET_OK;
-	else 
+	else
 		return PURPLE_CMD_RET_FAILED;
 }
 
@@ -2658,7 +2658,7 @@
 {
 	/* args = class, instance, recipient, message */
 	zephyr_account *zephyr = purple_conversation_get_gc(conv)->proto_data;
-	if ( zephyr_send_message(zephyr,args[0],args[1],args[2],args[3],zephyr_get_signature(),"")) 
+	if ( zephyr_send_message(zephyr,args[0],args[1],args[2],args[3],zephyr_get_signature(),""))
 		return PURPLE_CMD_RET_OK;
 	else
 		return PURPLE_CMD_RET_FAILED;
@@ -2669,7 +2669,7 @@
 {
 	/* args = instance, recipient, message */
 	zephyr_account *zephyr = purple_conversation_get_gc(conv)->proto_data;
-	if ( zephyr_send_message(zephyr,"message",args[0],args[1],args[2],zephyr_get_signature(),"")) 
+	if ( zephyr_send_message(zephyr,"message",args[0],args[1],args[2],zephyr_get_signature(),""))
 		return PURPLE_CMD_RET_OK;
 	else
 		return PURPLE_CMD_RET_FAILED;
@@ -2680,7 +2680,7 @@
 {
 	/* args = class, message */
 	zephyr_account *zephyr = purple_conversation_get_gc(conv)->proto_data;
-	if ( zephyr_send_message(zephyr,args[0],"PERSONAL","",args[1],zephyr_get_signature(),"")) 
+	if ( zephyr_send_message(zephyr,args[0],"PERSONAL","",args[1],zephyr_get_signature(),""))
 		return PURPLE_CMD_RET_OK;
 	else
 		return PURPLE_CMD_RET_FAILED;
@@ -2791,13 +2791,13 @@
 	ZSubscription_t subs;
 	if (use_zeph02(zephyr)) {
 		GString* subout = g_string_new("Subscription list<br>");
-		
+
 		title = g_strdup_printf("Server subscriptions for %s", zephyr->username);
-		
+
 		if (zephyr->port == 0) {
 			purple_debug_error("zephyr", "error while retrieving port\n");
 			return;
-		} 
+		}
 		if ((retval = ZRetrieveSubscriptions(zephyr->port,&nsubs)) != ZERR_NONE) {
 			/* XXX better error handling */
 			purple_debug_error("zephyr", "error while retrieving subscriptions from server\n");
@@ -2969,13 +2969,13 @@
 
 	option = purple_account_option_bool_new(_("Import from .anyone"), "read_anyone", TRUE);
 	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
- 
+
 	option = purple_account_option_bool_new(_("Import from .zephyr.subs"), "read_zsubs", TRUE);
 	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
- 
+
 	option = purple_account_option_string_new(_("Realm"), "realm", "");
 	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
-	
+
 	option = purple_account_option_string_new(_("Exposure"), "exposure_level", tmp?tmp: EXPOSE_REALMVIS);
 	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);