comparison libpurple/conversation.c @ 17070:73556f13c3b5

Use switch() rather than a series of if() statements which hit all the values of the enum
author Evan Schoenberg <evan.s@dreskin.net>
date Sat, 12 May 2007 20:33:26 +0000
parents 56823a55581a
children 7ade887fd3f6 e4ee1c5bd51e
comparison
equal deleted inserted replaced
17069:f1547260a11e 17070:73556f13c3b5
968 968
969 if (im->typing_state != state) 969 if (im->typing_state != state)
970 { 970 {
971 im->typing_state = state; 971 im->typing_state = state;
972 972
973 if (state == PURPLE_TYPING) 973 switch (state)
974 { 974 {
975 purple_signal_emit(purple_conversations_get_handle(), 975 case PURPLE_TYPING:
976 "buddy-typing", im->conv->account, im->conv->name); 976 purple_signal_emit(purple_conversations_get_handle(),
977 } 977 "buddy-typing", im->conv->account, im->conv->name);
978 else if (state == PURPLE_TYPED) 978 break;
979 { 979 case PURPLE_TYPED:
980 purple_signal_emit(purple_conversations_get_handle(), 980 purple_signal_emit(purple_conversations_get_handle(),
981 "buddy-typed", im->conv->account, im->conv->name); 981 "buddy-typed", im->conv->account, im->conv->name);
982 } 982 break;
983 else if (state == PURPLE_NOT_TYPING) 983 case PURPLE_NOT_TYPING:
984 { 984 purple_signal_emit(purple_conversations_get_handle(),
985 purple_signal_emit(purple_conversations_get_handle(), 985 "buddy-typing-stopped", im->conv->account, im->conv->name);
986 "buddy-typing-stopped", im->conv->account, im->conv->name); 986 break;
987 } 987 }
988 } 988 }
989 } 989 }
990 990
991 PurpleTypingState 991 PurpleTypingState