From e2b56bc9c06c95e14d25750caa70e24dfbb0e7b1 Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@4f64403b-2f21-0410-a795-97e2b3489a10> Date: Wed, 4 Mar 2009 09:43:15 +0000 Subject: fix for the occasional crash git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@437 4f64403b-2f21-0410-a795-97e2b3489a10 --- metacontacts/meta_options.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'metacontacts/meta_options.c') diff --git a/metacontacts/meta_options.c b/metacontacts/meta_options.c index 25b13db..b6f7c57 100644 --- a/metacontacts/meta_options.c +++ b/metacontacts/meta_options.c @@ -316,10 +316,19 @@ int Meta_ReadOptions(MetaOptions *opt) { #define ID_STATUS_OUTTOLUNCH 40080 ->3 */ -int status_order[10] = {8, 0, 4, 7, 6, 5, 1, 0, 2, 3}; - int GetDefaultPrio(int status) { - return status_order[status - ID_STATUS_OFFLINE]; + switch( status ) { + case ID_STATUS_OFFLINE: return 8; + case ID_STATUS_AWAY: return 4; + case ID_STATUS_DND: return 7; + case ID_STATUS_NA: return 6; + case ID_STATUS_OCCUPIED: return 5; + case ID_STATUS_FREECHAT: return 1; + case ID_STATUS_ONTHEPHONE: return 2; + case ID_STATUS_OUTTOLUNCH: return 3; + } + + return 0; } typedef struct { -- cgit v1.2.3