Ignore:
Timestamp:
2006-09-23T16:18:24Z (18 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
172a73f1
Parents:
d8e0484
Message:

Implemented a list of away states, using this for a better set_away(), and
got rid of the double <presence> tag sent because of presence_announce().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/jabber_util.c

    rd8e0484 r5e202b0  
    9292        return node;
    9393}
     94
     95const struct jabber_away_state jabber_away_state_list[] =
     96{
     97        { "away",  "Away" },
     98        { "chat",  "Free for Chat" },
     99        { "dnd",   "Do not Disturb" },
     100        { "xa",    "Extended Away" },
     101        { "",      "Online" },
     102        { "",      NULL }
     103};
     104
     105const struct jabber_away_state *jabber_away_state_by_code( char *code )
     106{
     107        int i;
     108       
     109        for( i = 0; jabber_away_state_list[i].full_name; i ++ )
     110                if( g_strcasecmp( jabber_away_state_list[i].code, code ) == 0 )
     111                        return jabber_away_state_list + i;
     112       
     113        return NULL;
     114}
     115
     116const struct jabber_away_state *jabber_away_state_by_name( char *name )
     117{
     118        int i;
     119       
     120        for( i = 0; jabber_away_state_list[i].full_name; i ++ )
     121                if( g_strcasecmp( jabber_away_state_list[i].full_name, name ) == 0 )
     122                        return jabber_away_state_list + i;
     123       
     124        return NULL;
     125}
Note: See TracChangeset for help on using the changeset viewer.