diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-11-16 17:13:37 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-11-16 17:13:37 +0000 |
commit | 92f8aed964cff174491adbf308974ab09874926b (patch) | |
tree | 537115d586203b856a3ef3ab351a8b783c06c907 /src/conversation/gnunet-conversation.c | |
parent | a4d350f7de02167577ba8c760f08a0866bc2c9e7 (diff) | |
download | gnunet-92f8aed964cff174491adbf308974ab09874926b.tar.gz gnunet-92f8aed964cff174491adbf308974ab09874926b.zip |
-doxygen, minor bug fixes
Diffstat (limited to 'src/conversation/gnunet-conversation.c')
-rw-r--r-- | src/conversation/gnunet-conversation.c | 46 |
1 files changed, 41 insertions, 5 deletions
diff --git a/src/conversation/gnunet-conversation.c b/src/conversation/gnunet-conversation.c index 5961046d1..45ecdac91 100644 --- a/src/conversation/gnunet-conversation.c +++ b/src/conversation/gnunet-conversation.c | |||
@@ -840,6 +840,9 @@ do_resume (const char *args) | |||
840 | static void | 840 | static void |
841 | do_reject (const char *args) | 841 | do_reject (const char *args) |
842 | { | 842 | { |
843 | struct CallList *cl; | ||
844 | char buf[32]; | ||
845 | |||
843 | if (NULL != call) | 846 | if (NULL != call) |
844 | { | 847 | { |
845 | GNUNET_CONVERSATION_call_stop (call); | 848 | GNUNET_CONVERSATION_call_stop (call); |
@@ -849,20 +852,53 @@ do_reject (const char *args) | |||
849 | switch (phone_state) | 852 | switch (phone_state) |
850 | { | 853 | { |
851 | case PS_LOOKUP_EGO: | 854 | case PS_LOOKUP_EGO: |
852 | case PS_LISTEN: | ||
853 | case PS_ERROR: | 855 | case PS_ERROR: |
854 | FPRINTF (stderr, | 856 | FPRINTF (stderr, |
855 | "%s", | 857 | "%s", |
856 | _("There is no call that could be cancelled right now.\n")); | 858 | _("There is no call that could be cancelled right now.\n")); |
857 | return; | 859 | return; |
860 | case PS_LISTEN: | ||
861 | /* look for active incoming calls to refuse */ | ||
862 | cl = cl_head; | ||
863 | if (NULL == cl) | ||
864 | { | ||
865 | FPRINTF (stderr, | ||
866 | _("There is no incoming call to refuse here!\n")); | ||
867 | return; | ||
868 | } | ||
869 | if ( (NULL != cl->next) || (NULL != args) ) | ||
870 | { | ||
871 | for (cl = cl_head; NULL != cl; cl = cl->next) | ||
872 | { | ||
873 | GNUNET_snprintf (buf, sizeof (buf), | ||
874 | "%u", | ||
875 | cl->caller_num); | ||
876 | if (0 == strcmp (buf, args)) | ||
877 | break; | ||
878 | } | ||
879 | } | ||
880 | if (NULL == cl) | ||
881 | { | ||
882 | FPRINTF (stderr, | ||
883 | _("There is no incoming call `%s' to refuse right now!\n"), | ||
884 | args); | ||
885 | return; | ||
886 | } | ||
887 | GNUNET_CONVERSATION_caller_hang_up (cl->caller); | ||
888 | GNUNET_CONTAINER_DLL_remove (cl_head, | ||
889 | cl_tail, | ||
890 | cl); | ||
891 | GNUNET_free (cl->caller_id); | ||
892 | GNUNET_free (cl); | ||
893 | break; | ||
858 | case PS_ACCEPTED: | 894 | case PS_ACCEPTED: |
859 | /* expected state, do rejection logic */ | 895 | /* expected state, do rejection logic */ |
896 | GNUNET_assert (NULL != cl_active); | ||
897 | GNUNET_CONVERSATION_caller_hang_up (cl_active->caller); | ||
898 | cl_active = NULL; | ||
899 | phone_state = PS_LISTEN; | ||
860 | break; | 900 | break; |
861 | } | 901 | } |
862 | GNUNET_assert (NULL != cl_active); | ||
863 | GNUNET_CONVERSATION_caller_hang_up (cl_active->caller); | ||
864 | cl_active = NULL; | ||
865 | phone_state = PS_LISTEN; | ||
866 | } | 902 | } |
867 | 903 | ||
868 | 904 | ||