diff libpurple/protocols/simple/simple.c @ 25871:65cfc59858cf

propagate from branch 'im.pidgin.pidgin' (head d5bb29138cbe033bbfd8ec689203d73818765327) to branch 'im.pidgin.pidgin.next.minor' (head 35ee8e40db640867e5b9239030cdc326e7f0a005)
author Gary Kramlich <grim@reaperworld.com>
date Sat, 13 Dec 2008 05:45:27 +0000
parents 9bdd3ab8087f 222be065ce6e
children f8dbd57cf635
line wrap: on
line diff
--- a/libpurple/protocols/simple/simple.c	Wed Dec 03 01:58:45 2008 +0000
+++ b/libpurple/protocols/simple/simple.c	Sat Dec 13 05:45:27 2008 +0000
@@ -197,7 +197,7 @@
 	struct simple_account_data *sip = (struct simple_account_data *)gc->proto_data;
 	struct simple_buddy *b;
 	const char *name = purple_buddy_get_name(buddy);
-	if(strncmp("sip:", name, 4)) {
+	if(strcmp("sip:", name)) {
 		gchar *buf = g_strdup_printf("sip:%s", name);
 		purple_blist_rename_buddy(buddy, buf);
 		g_free(buf);
@@ -890,7 +890,7 @@
 
 
 	tmp = sipmsg_find_header(msg, "Event");
-	if(tmp && !strncmp(tmp, "vnd-microsoft-roaming-contacts", 30)){
+	if(tmp && !strcmp(tmp, "vnd-microsoft-roaming-contacts")){
 
 		purple_debug_info("simple", "simple_add_lcs_contacts->%s-%d\n", msg->body, len);
 		/*Convert the contact from XML to Purple Buddies*/
@@ -1022,7 +1022,7 @@
 static void simple_send_message(struct simple_account_data *sip, const char *to, const char *msg, const char *type) {
 	gchar *hdr;
 	gchar *fullto;
-	if(strncmp("sip:", to, 4)) {
+	if(strcmp("sip:", to)) {
 		fullto = g_strdup_printf("sip:%s", to);
 	} else {
 		fullto = g_strdup(to);
@@ -1059,12 +1059,12 @@
 	purple_debug(PURPLE_DEBUG_MISC, "simple", "got message from %s: %s\n", from, msg->body);
 
 	contenttype = sipmsg_find_header(msg, "Content-Type");
-	if(!contenttype || !strncmp(contenttype, "text/plain", 10) || !strncmp(contenttype, "text/html", 9)) {
+	if(!contenttype || !strcmp(contenttype, "text/plain") || !strcmp(contenttype, "text/html")) {
 		serv_got_im(sip->gc, from, msg->body, 0, time(NULL));
 		send_sip_response(sip->gc, msg, 200, "OK", NULL);
 		found = TRUE;
 	}
-	if(!strncmp(contenttype, "application/im-iscomposing+xml", 30)) {
+	else if(!strcmp(contenttype, "application/im-iscomposing+xml")) {
 		xmlnode *isc = xmlnode_from_str(msg->body, msg->bodylen);
 		xmlnode *state;
 		gchar *statedata;
@@ -1086,8 +1086,10 @@
 
 		statedata = xmlnode_get_data(state);
 		if(statedata) {
-			if(strstr(statedata, "active")) serv_got_typing(sip->gc, from, 0, PURPLE_TYPING);
-			else serv_got_typing_stopped(sip->gc, from);
+			if(strstr(statedata, "active"))
+				serv_got_typing(sip->gc, from, 0, PURPLE_TYPING);
+			else
+				serv_got_typing_stopped(sip->gc, from);
 
 			g_free(statedata);
 		}