Mercurial > pidgin
comparison src/protocols/simple/simple.c @ 13081:7768cfa2e67e
[gaim-migrate @ 15443]
fix for [ 1418678 ] Missing sip: in SUBSCRIBE (SIP)
committer: Tailor Script <tailor@pidgin.im>
| author | Thomas Butter <tbutter> |
|---|---|
| date | Tue, 31 Jan 2006 12:07:10 +0000 |
| parents | 256abf4dd912 |
| children | f6ed8290f1cf |
comparison
equal
deleted
inserted
replaced
| 13080:1dc109c12ef5 | 13081:7768cfa2e67e |
|---|---|
| 653 static void simple_subscribe(struct simple_account_data *sip, struct simple_buddy *buddy) { | 653 static void simple_subscribe(struct simple_account_data *sip, struct simple_buddy *buddy) { |
| 654 gchar *contact = "Expires: 300\r\nAccept: application/pidf+xml\r\nEvent: presence\r\n"; | 654 gchar *contact = "Expires: 300\r\nAccept: application/pidf+xml\r\nEvent: presence\r\n"; |
| 655 gchar *to; | 655 gchar *to; |
| 656 if(strstr(buddy->name,"sip:")) to = g_strdup(buddy->name); | 656 if(strstr(buddy->name,"sip:")) to = g_strdup(buddy->name); |
| 657 else to = g_strdup_printf("sip:%s",buddy->name); | 657 else to = g_strdup_printf("sip:%s",buddy->name); |
| 658 contact = g_strdup_printf("%sContact: <%s@%s>\r\n", contact, sip->username, sip->servername); | 658 contact = g_strdup_printf("%sContact: <sip:%s@%s>\r\n", contact, sip->username, sip->servername); |
| 659 /* subscribe to buddy presence | 659 /* subscribe to buddy presence |
| 660 * we dont need to know the status so we do not need a callback */ | 660 * we dont need to know the status so we do not need a callback */ |
| 661 | 661 |
| 662 send_sip_request(sip->gc, "SUBSCRIBE",to, to, contact, "", NULL, process_subscribe_response); | 662 send_sip_request(sip->gc, "SUBSCRIBE",to, to, contact, "", NULL, process_subscribe_response); |
| 663 | 663 |
| 982 if(expire) | 982 if(expire) |
| 983 watcher->expire = time(NULL) + strtol(expire, NULL, 10); | 983 watcher->expire = time(NULL) + strtol(expire, NULL, 10); |
| 984 else | 984 else |
| 985 watcher->expire = time(NULL) + 600; | 985 watcher->expire = time(NULL) + 600; |
| 986 sipmsg_remove_header(msg, "Contact"); | 986 sipmsg_remove_header(msg, "Contact"); |
| 987 tmp = g_strdup_printf("<%s@%s>",sip->username, sip->servername); | 987 tmp = g_strdup_printf("<sip:%s@%s>",sip->username, sip->servername); |
| 988 sipmsg_add_header(msg, "Contact", tmp); | 988 sipmsg_add_header(msg, "Contact", tmp); |
| 989 gaim_debug_info("simple","got subscribe: name %s ourtag %s theirtag %s callid %s\n", watcher->name, watcher->dialog.ourtag, watcher->dialog.theirtag, watcher->dialog.callid); | 989 gaim_debug_info("simple","got subscribe: name %s ourtag %s theirtag %s callid %s\n", watcher->name, watcher->dialog.ourtag, watcher->dialog.theirtag, watcher->dialog.callid); |
| 990 send_sip_response(sip->gc, msg, 200, "Ok", NULL); | 990 send_sip_response(sip->gc, msg, 200, "Ok", NULL); |
| 991 g_free(tmp); | 991 g_free(tmp); |
| 992 send_notify(sip, watcher); | 992 send_notify(sip, watcher); |
