diff src/protocols/msn/page.c @ 9092:9e5a709c30a8

[gaim-migrate @ 9869] More patches by shx. These prevent disconnects with message lengths that are past the allowed MSN message length, fixes pager messages, and provides a better error dialog stuff for MSN errors. I hope I got that all right. :) committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Thu, 27 May 2004 08:19:29 +0000
parents 1e211dde3cae
children ab6636c5a136
line wrap: on
line diff
--- a/src/protocols/msn/page.c	Thu May 27 08:04:11 2004 +0000
+++ b/src/protocols/msn/page.c	Thu May 27 08:19:29 2004 +0000
@@ -22,28 +22,6 @@
 #include "msn.h"
 #include "page.h"
 
-#define GET_NEXT(tmp) \
-	while (*(tmp) && *(tmp) != ' ' && *(tmp) != '\r') \
-		(tmp)++; \
-	if (*(tmp) != '\0') *(tmp)++ = '\0'; \
-	if (*(tmp) == '\n') *(tmp)++; \
-	while (*(tmp) && *(tmp) == ' ') \
-		(tmp)++
-
-#define GET_NEXT_LINE(tmp) \
-	while (*(tmp) && *(tmp) != '\r') \
-		(tmp)++; \
-	if (*(tmp) != '\0') *(tmp)++ = '\0'; \
-	if (*(tmp) == '\n') *(tmp)++
-
-/*
- * <TEXT xml:space="preserve" enc="utf-8"> == 39
- * </TEXT>                                 ==  7
- *                                           ----
- *                                            46
- */
-#define MSN_PAGE_BASE_SIZE 46
-
 MsnPage *
 msn_page_new(void)
 {
@@ -51,8 +29,6 @@
 
 	page = g_new0(MsnPage, 1);
 
-	page->size = MSN_PAGE_BASE_SIZE;
-
 	return page;
 }
 
@@ -84,15 +60,8 @@
 		g_strdup_printf("<TEXT xml:space=\"preserve\" enc=\"utf-8\">%s</TEXT>",
 						msn_page_get_body(page));
 
-	if (page->size != strlen(str))
-	{
-		gaim_debug(GAIM_DEBUG_ERROR, "msn",
-				   "Outgoing page size (%d) and string length (%d) "
-				   "do not match!\n", page->size, strlen(str));
-	}
-
 	if (ret_size != NULL)
-		*ret_size = page->size - 1;
+		*ret_size = strlen(str);
 
 	return str;
 }
@@ -104,14 +73,9 @@
 	g_return_if_fail(body != NULL);
 
 	if (page->body != NULL)
-	{
-		page->size -= strlen(page->body);
 		g_free(page->body);
-	}
 
 	page->body = g_strdup(body);
-
-	page->size += strlen(body);
 }
 
 const char *
@@ -121,4 +85,3 @@
 
 	return page->body;
 }
-