changeset 13184:2d68ea9616b3

[gaim-migrate @ 15547] datallah noticed that sip: isn't added to a buddies name if the buddies->send message menu entry is used. committer: Tailor Script <tailor@pidgin.im>
author Thomas Butter <tbutter>
date Wed, 08 Feb 2006 19:49:54 +0000
parents 02d40c160599
children 87d9db90bf6e
files src/protocols/simple/simple.c
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/simple/simple.c	Wed Feb 08 19:14:16 2006 +0000
+++ b/src/protocols/simple/simple.c	Wed Feb 08 19:49:54 2006 +0000
@@ -757,13 +757,20 @@
 
 static void simple_send_message(struct simple_account_data *sip, char *to, char *msg, char *type) {
 	gchar *hdr;
+	gchar *fullto;
+	if(strncmp("sip:",to,4)) {
+		fullto = g_strdup_printf("sip:%s",to);
+	} else {
+		fullto = g_strdup(to);
+	}
 	if(type) {
 		hdr = g_strdup_printf("Content-Type: %s\r\n",type);
 	} else {
 		hdr = g_strdup("Content-Type: text/plain\r\n");
 	}
-	send_sip_request(sip->gc, "MESSAGE", to, to, hdr, msg, NULL, NULL);
+	send_sip_request(sip->gc, "MESSAGE", fullto, fullto, hdr, msg, NULL, NULL);
 	g_free(hdr);
+	g_free(fullto);
 }
 
 static int simple_im_send(GaimConnection *gc, const char *who, const char *what, GaimMessageFlags flags) {