Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/msn/tables.c

    r0714d51 r6048744  
    2929const struct msn_away_state msn_away_state_list[] =
    3030{
    31         { "NLN", "" },
    32         { "AWY", "Away" },
    33         { "BSY", "Busy" },
    34         { "IDL", "Idle" },
    35         { "BRB", "Be Right Back" },
    36         { "PHN", "On the Phone" },
    37         { "LUN", "Out to Lunch" },
    38         { "HDN", "Hidden" },
    39         { "",    "" }
     31        {  0, "NLN", "Available" },
     32        {  1, "BSY", "Busy" },
     33        {  3, "IDL", "Idle" },
     34        {  5, "BRB", "Be Right Back" },
     35        {  7, "AWY", "Away" },
     36        {  9, "PHN", "On the Phone" },
     37        { 11, "LUN", "Out to Lunch" },
     38        { 13, "HDN", "Hidden" },
     39        { -1, "",    "" }
    4040};
     41
     42const struct msn_away_state *msn_away_state_by_number( int number )
     43{
     44        int i;
     45       
     46        for( i = 0; msn_away_state_list[i].number > -1; i ++ )
     47                if( msn_away_state_list[i].number == number )
     48                        return( msn_away_state_list + i );
     49       
     50        return( NULL );
     51}
    4152
    4253const struct msn_away_state *msn_away_state_by_code( char *code )
     
    4455        int i;
    4556       
    46         for( i = 0; *msn_away_state_list[i].code; i ++ )
     57        for( i = 0; msn_away_state_list[i].number > -1; i ++ )
    4758                if( g_strcasecmp( msn_away_state_list[i].code, code ) == 0 )
    4859                        return( msn_away_state_list + i );
    4960       
    50         return NULL;
     61        return( NULL );
    5162}
    5263
     
    5566        int i;
    5667       
    57         for( i = 0; *msn_away_state_list[i].code; i ++ )
     68        for( i = 0; msn_away_state_list[i].number > -1; i ++ )
    5869                if( g_strcasecmp( msn_away_state_list[i].name, name ) == 0 )
    5970                        return( msn_away_state_list + i );
    6071       
    61         return NULL;
     72        return( NULL );
    6273}
    6374
Note: See TracChangeset for help on using the changeset viewer.