Mercurial > pidgin.yaz
diff libpurple/protocols/yahoo/yahoo_filexfer.c @ 20254:f379a2e9e939
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
through 45dd8a34b6dda68660a7f026677c9478247610ad
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Fri, 28 Sep 2007 16:58:29 +0000 |
parents | 63b1ce39965c |
children | ffbd2e3e10e4 |
line wrap: on
line diff
--- a/libpurple/protocols/yahoo/yahoo_filexfer.c Fri Sep 28 16:58:14 2007 +0000 +++ b/libpurple/protocols/yahoo/yahoo_filexfer.c Fri Sep 28 16:58:29 2007 +0000 @@ -452,26 +452,29 @@ { struct yahoo_pair *pair = l->data; - if(pair->key == 5) /* Get who the packet is for */ + switch(pair->key) { + case 5: /* Get who the packet is for */ me = pair->value; - - if(pair->key == 4) /* Get who the packet is from */ + break; + case 4: /* Get who the packet is from */ from = pair->value; - - if(pair->key == 49) /* Get the type of service */ + break; + case 49: /* Get the type of service */ service = pair->value; - - if(pair->key == 14) /* Get the 'message' of the packet */ + break; + case 14: /* Get the 'message' of the packet */ message = pair->value; - - if(pair->key == 13) /* Get the command associated with this packet */ + break; + case 13: /* Get the command associated with this packet */ command = pair->value; - - if(pair->key == 63) /* IMVironment name and version */ + break; + case 63: /* IMVironment name and version */ imv = pair->value; - - if(pair->key == 64) /* Not sure, but it does vary with initialization of Doodle */ + break; + case 64: /* Not sure, but it does vary with initialization of Doodle */ unknown = pair->value; /* So, I'll keep it (for a little while atleast) */ + break; + } l = l->next; } @@ -481,7 +484,7 @@ { /* Check for a Doodle packet and handle it accordingly */ if(strstr(imv, "doodle;") != NULL) - yahoo_doodle_process(gc, me, from, command, message); + yahoo_doodle_process(gc, me, from, command, message, imv); /* If an IMVIRONMENT packet comes without a specific imviroment name */ if(!strcmp(imv, ";0")) @@ -513,24 +516,35 @@ for (l = pkt->hash; l; l = l->next) { struct yahoo_pair *pair = l->data; - if (pair->key == 4) + switch (pair->key) { + case 4: from = pair->value; - if (pair->key == 5) + break; + case 5: to = pair->value; - if (pair->key == 14) + break; + case 14: msg = pair->value; - if (pair->key == 20) + break; + case 20: url = pair->value; - if (pair->key == 38) + break; + case 38: expires = strtol(pair->value, NULL, 10); - if (pair->key == 27) + break; + case 27: filename = pair->value; - if (pair->key == 28) + break; + case 28: filesize = atol(pair->value); - if (pair->key == 49) + break; + case 49: service = pair->value; - if (pair->key == 63) + break; + case 63: imv = pair->value; + break; + } } /*