Mercurial > pidgin
changeset 13613:723fd573111c
[gaim-migrate @ 15999]
Refactor the codeflow of gaim_normalize() slightly so that it's easier to read.
committer: Tailor Script <tailor@pidgin.im>
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Mon, 10 Apr 2006 20:55:03 +0000 |
parents | dd03aa8a28ad |
children | e186876efaf3 |
files | src/util.c |
diffstat | 1 files changed, 14 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/src/util.c Mon Apr 10 20:51:51 2006 +0000 +++ b/src/util.c Mon Apr 10 20:55:03 2006 +0000 @@ -2612,20 +2612,22 @@ const char * gaim_normalize(const GaimAccount *account, const char *str) { - GaimPlugin *prpl = NULL; - GaimPluginProtocolInfo *prpl_info = NULL; const char *ret = NULL; - if(account) - prpl = gaim_find_prpl(gaim_account_get_protocol_id(account)); - - if(prpl) - prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(prpl); - - if(prpl_info && prpl_info->normalize) - ret = prpl_info->normalize(account, str); - - if(!ret) + if (account == NULL) + { + GaimPlugin *prpl = gaim_find_prpl(gaim_account_get_protocol_id(account)); + + if (prpl != NULL) + { + GaimPluginProtocolInfo *prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(prpl); + + if(prpl_info && prpl_info->normalize) + ret = prpl_info->normalize(account, str); + } + } + + if (ret != NULL) { static char buf[BUF_LEN]; char *tmp;