Mercurial > pidgin.yaz
diff src/savedstatuses.c @ 13012:e3b9c6c7bcf6
[gaim-migrate @ 15365]
Don't create duplicate transient statuses. So like, if you switch between
"Available" and "Away" a bunch of times and use the same message everywhere,
you'll only have one of each in your list of recent statuses
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Mon, 23 Jan 2006 04:54:37 +0000 |
parents | e5f780a6137b |
children | 22f8ed4e5294 |
line wrap: on
line diff
--- a/src/savedstatuses.c Mon Jan 23 04:25:04 2006 +0000 +++ b/src/savedstatuses.c Mon Jan 23 04:54:37 2006 +0000 @@ -798,6 +798,27 @@ return NULL; } +GaimSavedStatus * +gaim_savedstatus_find_by_type_and_message(GaimStatusPrimitive type, + const char *message) +{ + GList *iter; + GaimSavedStatus *status; + + for (iter = saved_statuses; iter != NULL; iter = iter->next) + { + status = (GaimSavedStatus *)iter->data; + if ((status->type == type) && + (((status->message == NULL) && (message == NULL)) || + ((status->message != NULL) && (message != NULL) && !strcmp(status->message, message)))) + { + return status; + } + } + + return NULL; +} + gboolean gaim_savedstatus_is_transient(const GaimSavedStatus *saved_status) {