Mercurial > pidgin
comparison src/protocols/simple/simple.c @ 13678:299536c4caf1
[gaim-migrate @ 16080]
Set the SIP/SIMPLE user-agent string to something more that I think makes more sense, and set wants_to_die in two places when disconnecting. This causes the account to be disable until the user re-enables it.
committer: Tailor Script <tailor@pidgin.im>
| author | Mark Doliner <mark@kingant.net> |
|---|---|
| date | Sat, 22 Apr 2006 15:13:51 +0000 |
| parents | d0fc90e56b5e |
| children | 6bee2e80e42c |
comparison
equal
deleted
inserted
replaced
| 13677:7f5b3313dd07 | 13678:299536c4caf1 |
|---|---|
| 622 /* Don't know what epid is, but LCS wants it */ | 622 /* Don't know what epid is, but LCS wants it */ |
| 623 "From: <sip:%s@%s>;tag=%s;epid=1234567890\r\n" | 623 "From: <sip:%s@%s>;tag=%s;epid=1234567890\r\n" |
| 624 "To: <%s>%s%s\r\n" | 624 "To: <%s>%s%s\r\n" |
| 625 "Max-Forwards: 10\r\n" | 625 "Max-Forwards: 10\r\n" |
| 626 "CSeq: %d %s\r\n" | 626 "CSeq: %d %s\r\n" |
| 627 "User-Agent: Gaim SIP/SIMPLE Plugin\r\n" | 627 "User-Agent: Gaim/" VERSION "\r\n" |
| 628 "Call-ID: %s\r\n" | 628 "Call-ID: %s\r\n" |
| 629 "%s%s" | 629 "%s%s" |
| 630 "Content-Length: %" G_GSIZE_FORMAT "\r\n\r\n%s", | 630 "Content-Length: %" G_GSIZE_FORMAT "\r\n\r\n%s", |
| 631 method, | 631 method, |
| 632 url, | 632 url, |
| 990 break; | 990 break; |
| 991 case 401: | 991 case 401: |
| 992 if(sip->registerstatus != 2) { | 992 if(sip->registerstatus != 2) { |
| 993 gaim_debug_info("simple", "REGISTER retries %d\n", sip->registrar.retries); | 993 gaim_debug_info("simple", "REGISTER retries %d\n", sip->registrar.retries); |
| 994 if(sip->registrar.retries > 3) { | 994 if(sip->registrar.retries > 3) { |
| 995 sip->gc->wants_to_die = TRUE; | |
| 995 gaim_connection_error(sip->gc, _("Wrong Password")); | 996 gaim_connection_error(sip->gc, _("Wrong Password")); |
| 996 return TRUE; | 997 return TRUE; |
| 997 } | 998 } |
| 998 tmp = sipmsg_find_header(msg, "WWW-Authenticate"); | 999 tmp = sipmsg_find_header(msg, "WWW-Authenticate"); |
| 999 fill_auth(sip, tmp, &sip->registrar); | 1000 fill_auth(sip, tmp, &sip->registrar); |
| 1579 | 1580 |
| 1580 const char *username = gaim_account_get_username(account); | 1581 const char *username = gaim_account_get_username(account); |
| 1581 gc = gaim_account_get_connection(account); | 1582 gc = gaim_account_get_connection(account); |
| 1582 | 1583 |
| 1583 if (strpbrk(username, " \t\v\r\n") != NULL) { | 1584 if (strpbrk(username, " \t\v\r\n") != NULL) { |
| 1585 gc->wants_to_die = TRUE; | |
| 1584 gaim_connection_error(gc, _("SIP usernames may not contain whitespaces or @ symbols")); | 1586 gaim_connection_error(gc, _("SIP usernames may not contain whitespaces or @ symbols")); |
| 1585 return; | 1587 return; |
| 1586 } | 1588 } |
| 1587 | 1589 |
| 1588 gc->proto_data = sip = g_new0(struct simple_account_data, 1); | 1590 gc->proto_data = sip = g_new0(struct simple_account_data, 1); |
