Minor patch to fix whitespace to make ext patch easier to read
"A. Craig West" <[email protected]> Fri, 5 Mar 2004 18:45:56 -0500 (EST)
| Newsgroups | gmane.network.everybuddy.devel |
|---|---|
| Message-ID | <[email protected]> |
I committed this already, as it modifies no actual code...
-------------------Begin Patch-----------------------
Index: yahoo.c
===================================================================
--- yahoo.c (revision 281)
+++ yahoo.c (working copy)
@@ -86,9 +86,9 @@
{
eb_local_account * la = (eb_local_account *)n->data;
if (la->service == &yahoo_service && GET_LAD(la)->id == id)
- {
- return la;
- }
+ {
+ return la;
+ }
}
return NULL;
}
@@ -108,7 +108,7 @@
if (lad->id != -1)
{
yahoo_close(lad->id);
- lad->id = -1;
+ lad->id = -1;
}
lad->id = yahoo_init(la->handle, eb_get_value(la->config_key, "password"));
@@ -135,7 +135,7 @@
{
yahoo_logoff(lad->id);
yahoo_close(lad->id);
- lad->id = -1;
+ lad->id = -1;
}
}
@@ -152,76 +152,76 @@
}
else
{
- /* Check if we are connected yet */
- if (!la->connected)
- {
- /* connect to the server */
- login(la);
- }
+ /* Check if we are connected yet */
+ if (!la->connected)
+ {
+ /* connect to the server */
+ login(la);
+ }
- if (!strcmp(state, "Online"))
- {
- st_id = YAHOO_STATUS_AVAILABLE;
- }
- else if (!strcmp(state, "BRB"))
- {
- st_id = YAHOO_STATUS_BRB;
- }
- else if (!strcmp(state, "Busy"))
- {
- st_id = YAHOO_STATUS_BUSY;
- }
- else if (!strcmp(state, "Not at Home"))
- {
- st_id = YAHOO_STATUS_NOTATHOME;
- }
- else if (!strcmp(state, "Not at Desk"))
- {
- st_id = YAHOO_STATUS_NOTATDESK;
- }
- else if (!strcmp(state, "Not in Office"))
- {
- st_id = YAHOO_STATUS_NOTINOFFICE;
- }
- else if (!strcmp(state, "Phone"))
- {
- st_id = YAHOO_STATUS_ONPHONE;
- }
- else if (!strcmp(state, "Vacation"))
- {
- st_id = YAHOO_STATUS_ONVACATION;
- }
- else if (!strcmp(state, "Lunch"))
- {
- st_id = YAHOO_STATUS_OUTTOLUNCH;
- }
- else if (!strcmp(state, "Stepped Out"))
- {
- st_id = YAHOO_STATUS_STEPPEDOUT;
- }
- else if (!strcmp(state, "Invisible"))
- {
- st_id = YAHOO_STATUS_INVISIBLE;
- lad->invisible = 1;
- }
- else if (!strcmp(state, "Idle"))
- {
- st_id = YAHOO_STATUS_IDLE;
- }
- else
- {
- st_id = YAHOO_STATUS_CUSTOM;
- st_str = state;
- }
+ if (!strcmp(state, "Online"))
+ {
+ st_id = YAHOO_STATUS_AVAILABLE;
+ }
+ else if (!strcmp(state, "BRB"))
+ {
+ st_id = YAHOO_STATUS_BRB;
+ }
+ else if (!strcmp(state, "Busy"))
+ {
+ st_id = YAHOO_STATUS_BUSY;
+ }
+ else if (!strcmp(state, "Not at Home"))
+ {
+ st_id = YAHOO_STATUS_NOTATHOME;
+ }
+ else if (!strcmp(state, "Not at Desk"))
+ {
+ st_id = YAHOO_STATUS_NOTATDESK;
+ }
+ else if (!strcmp(state, "Not in Office"))
+ {
+ st_id = YAHOO_STATUS_NOTINOFFICE;
+ }
+ else if (!strcmp(state, "Phone"))
+ {
+ st_id = YAHOO_STATUS_ONPHONE;
+ }
+ else if (!strcmp(state, "Vacation"))
+ {
+ st_id = YAHOO_STATUS_ONVACATION;
+ }
+ else if (!strcmp(state, "Lunch"))
+ {
+ st_id = YAHOO_STATUS_OUTTOLUNCH;
+ }
+ else if (!strcmp(state, "Stepped Out"))
+ {
+ st_id = YAHOO_STATUS_STEPPEDOUT;
+ }
+ else if (!strcmp(state, "Invisible"))
+ {
+ st_id = YAHOO_STATUS_INVISIBLE;
+ lad->invisible = 1;
+ }
+ else if (!strcmp(state, "Idle"))
+ {
+ st_id = YAHOO_STATUS_IDLE;
+ }
+ else
+ {
+ st_id = YAHOO_STATUS_CUSTOM;
+ st_str = state;
+ }
- if (la->ready)
- {
- /* Only set the away message if the connection is ready */
- yahoo_set_away(lad->id, st_id, st_str, away_msg != NULL);
- free(la->status_string);
- la->status_string = strdup(state);
- eb_local_account_update(la);
- }
+ if (la->ready)
+ {
+ /* Only set the away message if the connection is ready */
+ yahoo_set_away(lad->id, st_id, st_str, away_msg != NULL);
+ free(la->status_string);
+ la->status_string = strdup(state);
+ eb_local_account_update(la);
+ }
}
}
@@ -266,8 +266,8 @@
if (!GET_LAD(la)->invisible)
{
yahoo_set_away(GET_LAD(la)->id, YAHOO_STATUS_AVAILABLE, NULL, 0);
- free(la->status_string);
- la->status_string = strdup("Online");
+ free(la->status_string);
+ la->status_string = strdup("Online");
}
}
@@ -316,8 +316,8 @@
struct yahoo_buddy * yb = (struct yahoo_buddy *)n->data;
if (!strcmp(yb->id, acc->handle))
{
- yahoo_remove_buddy(GET_LAD(acc->buddy_of)->id, yb->id, yb->group);
- }
+ yahoo_remove_buddy(GET_LAD(acc->buddy_of)->id, yb->id, yb->group);
+ }
}
eb_del_account(acc);
@@ -337,8 +337,8 @@
done = 1;
yahoo_change_buddy_group(GET_LAD(acc->buddy_of)->id, yb->id, yb->group, new_group);
}
- else
- {
+ else
+ {
yahoo_remove_buddy(GET_LAD(acc->buddy_of)->id, yb->id, yb->group);
}
}
@@ -362,7 +362,7 @@
if (sbuf == NULL)
{
free(rbuf);
- return NULL;
+ return NULL;
}
yahoo_send_im(lad->id, NULL, to->handle, sbuf, 1);
@@ -413,7 +413,7 @@
int yahoo_plugin_finish(void)
{
- return 0;
+ return 0;
}
/**************************************************************************
@@ -434,26 +434,26 @@
if (la == NULL)
{
printf("Martian Yahoo connection\n");
- return;
+ return;
}
switch (succ)
{
case YAHOO_LOGIN_OK:
- {
+ {
la->ready = 1;
free(la->status_string);
la->status_string = strdup(GET_LAD(la)->invisible ? "Invisible" : "Online");
break;
}
default:
- {
+ {
char buf[512];
perror("Weird error");
sprintf(buf, "Disconnected from the Yahoo network - error code %d", succ);
eb_show_error(buf, "Yahoo error");
la->ready = la->connected = 0;
- free(la->status_string);
+ free(la->status_string);
la->status_string = strdup("Offline");
printf("Login error for %s (Yahoo id %d)\n", la->handle, id);
}
@@ -481,7 +481,7 @@
if (la == NULL)
{
printf("Got buddies on a martian account!\n");
- return;
+ return;
}
for (en = la->buddies; en != NULL; en = en->next)
@@ -496,7 +496,8 @@
eb_account * acc = eb_get_account(la->handle, "Yahoo", yb->id);
if (acc == NULL)
{
- acc = eb_add_account_plus(yb->group, (yb->real_name != NULL) ? (yb->real_name) : (yb->id), la, yb->id); }
+ acc = eb_add_account_plus(yb->group, (yb->real_name != NULL) ? (yb->real_name) : (yb->id), la, yb->id);
+ }
acc->protocol_data = &p;
}
@@ -506,10 +507,10 @@
if (acc->protocol_data == NULL) /* wasn't on the list */
{
- p = 1;
- free(acc->status_string);
- acc->status_string = strdup("???");
- }
+ p = 1;
+ free(acc->status_string);
+ acc->status_string = strdup("???");
+ }
}
if (p)
@@ -586,7 +587,7 @@
if (la == NULL)
{
printf("Martian Yahoo connection\n");
- return;
+ return;
}
acc = eb_get_account(la->handle, "Yahoo", who);
if (acc == NULL)
@@ -603,70 +604,70 @@
switch (stat)
{
case YAHOO_STATUS_AVAILABLE:
- {
+ {
acc->status = EB_ACCOUNT_ONLINE;
acc->status_string = strdup("");
break;
}
case YAHOO_STATUS_BRB:
- {
- acc->status_string = strdup("BRB");
- break;
- }
+ {
+ acc->status_string = strdup("BRB");
+ break;
+ }
case YAHOO_STATUS_BUSY:
- {
- acc->status_string = strdup("Busy");
- break;
- }
+ {
+ acc->status_string = strdup("Busy");
+ break;
+ }
case YAHOO_STATUS_NOTATHOME:
- {
- acc->status_string = strdup("Not at Home");
- break;
- }
+ {
+ acc->status_string = strdup("Not at Home");
+ break;
+ }
case YAHOO_STATUS_NOTATDESK:
- {
- acc->status_string = strdup("Not at Desk");
- break;
- }
+ {
+ acc->status_string = strdup("Not at Desk");
+ break;
+ }
case YAHOO_STATUS_NOTINOFFICE:
- {
- acc->status_string = strdup("Not in Office");
- break;
- }
+ {
+ acc->status_string = strdup("Not in Office");
+ break;
+ }
case YAHOO_STATUS_ONPHONE:
- {
- acc->status_string = strdup("Phone");
- break;
- }
+ {
+ acc->status_string = strdup("Phone");
+ break;
+ }
case YAHOO_STATUS_ONVACATION:
- {
- acc->status_string = strdup("On Vacation");
- break;
- }
+ {
+ acc->status_string = strdup("On Vacation");
+ break;
+ }
case YAHOO_STATUS_OUTTOLUNCH:
- {
- acc->status_string = strdup("Lunch");
- break;
- }
+ {
+ acc->status_string = strdup("Lunch");
+ break;
+ }
case YAHOO_STATUS_STEPPEDOUT:
- {
- acc->status_string = strdup("Stepped Out");
- break;
- }
+ {
+ acc->status_string = strdup("Stepped Out");
+ break;
+ }
case YAHOO_STATUS_IDLE:
- {
- acc->status_string = strdup("Idle");
- break;
- }
+ {
+ acc->status_string = strdup("Idle");
+ break;
+ }
case YAHOO_STATUS_OFFLINE:
- {
- do_login = 0;
+ {
+ do_login = 0;
acc->status = EB_ACCOUNT_OFFLINE;
acc->status_string = strdup("Offline");
break;
}
default:
- {
+ {
acc->status = away ? EB_ACCOUNT_AWAY : EB_ACCOUNT_ONLINE;
acc->status_string = strdup(msg);
}
@@ -703,7 +704,7 @@
if (la == NULL)
{
printf("Martian Yahoo connection\n");
- return;
+ return;
}
acc = eb_get_account(la->handle, "Yahoo", who);
if (acc == NULL)
@@ -995,7 +996,7 @@
if (la == NULL)
{
printf("Martian Yahoo connection\n");
- return;
+ return;
}
if (eb_get_value(la->config_key, "mail_notify")[0] == '0')
@@ -1151,7 +1152,7 @@
if (la == NULL)
{
printf("Error on martian Yahoo acct\n");
- return;
+ return;
}
buf = (char *)malloc(strlen(err) + strlen(la->handle) + 128);
-------------------End Patch-----------------------
--
Craig West Ph: (416) 666-1645 | It's not a bug,
[email protected] | It's a feature...