Mercurial > pidgin.yaz
comparison libpurple/protocols/myspace/myspace.c @ 17347:aa8e70fa1edc
Add, but do not use, incomplete functions for using typing notifications.
author | Jeffrey Connelly <jaconnel@calpoly.edu> |
---|---|
date | Sat, 02 Jun 2007 21:46:22 +0000 |
parents | 73720427b132 |
children | d8903e1320a9 |
comparison
equal
deleted
inserted
replaced
17346:73720427b132 | 17347:aa8e70fa1edc |
---|---|
734 /* msim_msg_free(userinfo); */ /* TODO: Should we? */ | 734 /* msim_msg_free(userinfo); */ /* TODO: Should we? */ |
735 g_hash_table_destroy(body); | 735 g_hash_table_destroy(body); |
736 } | 736 } |
737 | 737 |
738 /** | 738 /** |
739 * Handle an incoming message. | 739 * Handle an incoming instant message. |
740 * | 740 * |
741 * @param session The session | 741 * @param session The session |
742 * @param msg Message from the server, containing 'f' (userid from) and 'msg'. | 742 * @param msg Message from the server, containing 'f' (userid from) and 'msg'. |
743 * | 743 * |
744 * @return 0, since msg can be freed. | 744 * @return 0, since msg can be freed. |
762 msim_lookup_user(session, userid, msim_incoming_im_cb, msg_text); | 762 msim_lookup_user(session, userid, msim_incoming_im_cb, msg_text); |
763 | 763 |
764 return 0; | 764 return 0; |
765 } | 765 } |
766 | 766 |
767 /** | |
768 * Handle an incoming action message. | |
769 * | |
770 * @param session | |
771 * @param msg | |
772 * | |
773 * @return 0 | |
774 * | |
775 * INCOMPLETE | |
776 */ | |
777 int msim_incoming_action(MsimSession *session, MsimMessage *msg) | |
778 { | |
779 /* TODO: process */ | |
780 purple_debug_info("msim", "msim_incoming_action: action <%s> from <%d>\n", | |
781 msim_msg_get_string(msg, "msg"), msim_msg_get_integer(msg, "f")); | |
782 return 0; | |
783 } | |
784 | |
785 /** | |
786 * Handle when our user starts or stops typing to another user. | |
787 * | |
788 * @param gc | |
789 * @param name The buddy name to which our user is typing to | |
790 * @param state PURPLE_TYPING, PURPLE_TYPED, PURPLE_NOT_TYPING | |
791 * | |
792 * NOT CURRENTLY USED OR COMPLETE | |
793 */ | |
794 unsigned int msim_send_typing(PurpleConnection *gc, const char *name, PurpleTypingState state) | |
795 { | |
796 char *typing_str; | |
797 | |
798 switch (state) | |
799 { | |
800 case PURPLE_TYPING: | |
801 typing_str = "%typing%"; | |
802 break; | |
803 | |
804 case PURPLE_TYPED: | |
805 case PURPLE_NOT_TYPING: | |
806 default: | |
807 typing_str = "%stoptyping%"; | |
808 break; | |
809 } | |
810 | |
811 purple_debug_info("msim", "msim_send_typing(%s): %d\n", name, state); | |
812 //msim_send_action(name, typing_str); | |
813 return 0; | |
814 } | |
767 | 815 |
768 /** | 816 /** |
769 * Process a message. | 817 * Process a message. |
770 * | 818 * |
771 * @param gc Connection. | 819 * @param gc Connection. |
820 { | 868 { |
821 case MSIM_BM_STATUS: | 869 case MSIM_BM_STATUS: |
822 return msim_status(session, msg); | 870 return msim_status(session, msg); |
823 case MSIM_BM_INSTANT: | 871 case MSIM_BM_INSTANT: |
824 return msim_incoming_im(session, msg); | 872 return msim_incoming_im(session, msg); |
873 case MSIM_BM_ACTION: | |
874 return msim_incoming_action(session, msg); | |
825 default: | 875 default: |
826 /* Not really an IM, but show it for informational | 876 /* Not really an IM, but show it for informational |
827 * purposes during development. */ | 877 * purposes during development. */ |
828 return msim_incoming_im(session, msg); | 878 return msim_incoming_im(session, msg); |
829 } | 879 } |
849 return 0; | 899 return 0; |
850 } | 900 } |
851 } | 901 } |
852 | 902 |
853 /** | 903 /** |
854 * Process a message reply from the server. | 904 * Process a persistance message reply from the server. |
855 * | 905 * |
856 * @param session | 906 * @param session |
857 * @param msg Message reply from server. | 907 * @param msg Message reply from server. |
858 * | 908 * |
859 * @return 0, since the 'msg' field is no longer needed. | 909 * @return 0, since the 'msg' field is no longer needed. |
1550 NULL, /* chat_info_defaults */ | 1600 NULL, /* chat_info_defaults */ |
1551 msim_login, /* login */ | 1601 msim_login, /* login */ |
1552 msim_close, /* close */ | 1602 msim_close, /* close */ |
1553 msim_send_im, /* send_im */ | 1603 msim_send_im, /* send_im */ |
1554 NULL, /* set_info */ | 1604 NULL, /* set_info */ |
1555 NULL, /* send_typing */ | 1605 msim_send_typing, /* send_typing */ |
1556 NULL, /* get_info */ | 1606 NULL, /* get_info */ |
1557 NULL, /* set_away */ | 1607 NULL, /* set_away */ |
1558 NULL, /* set_idle */ | 1608 NULL, /* set_idle */ |
1559 NULL, /* change_passwd */ | 1609 NULL, /* change_passwd */ |
1560 NULL, /* add_buddy TODO */ | 1610 NULL, /* add_buddy TODO */ |