diff options
author | irungentoo <irungentoo@gmail.com> | 2013-08-01 17:38:29 -0700 |
---|---|---|
committer | irungentoo <irungentoo@gmail.com> | 2013-08-01 17:38:29 -0700 |
commit | af8e84345171538e70e2e3562e1c51da32e306df (patch) | |
tree | bf683baa454e74241ead3f319105e3490c965481 /testing/nTox.c | |
parent | 276e3f9271241839083bfa22a4ba422c4b28785d (diff) | |
parent | 8abc0a346209512901254f981dab62c67a632f4a (diff) |
Merge pull request #229 from JFreegman/master
fixed friend add bugs and gave no message its own error
Diffstat (limited to 'testing/nTox.c')
-rw-r--r-- | testing/nTox.c | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/testing/nTox.c b/testing/nTox.c index 34d74d5a..81cac0b6 100644 --- a/testing/nTox.c +++ b/testing/nTox.c | |||
@@ -111,24 +111,28 @@ void line_eval(char lines[HISTORY][STRING_LENGTH], char *line) | |||
111 | char temp_id[128]; | 111 | char temp_id[128]; |
112 | for (i = 0; i < 128; i++) | 112 | for (i = 0; i < 128; i++) |
113 | temp_id[i] = line[i+prompt_offset]; | 113 | temp_id[i] = line[i+prompt_offset]; |
114 | |||
114 | int num = m_addfriend(hex_string_to_bin(temp_id), (uint8_t*)"Install Gentoo", sizeof("Install Gentoo")); | 115 | int num = m_addfriend(hex_string_to_bin(temp_id), (uint8_t*)"Install Gentoo", sizeof("Install Gentoo")); |
115 | char numstring[100]; | 116 | char numstring[100]; |
116 | switch (num) { | 117 | switch (num) { |
117 | case -1: | 118 | case -1: |
118 | sprintf(numstring, "[i] Incorrect key length"); | 119 | sprintf(numstring, "[i] Message is too long."); |
119 | break; | 120 | break; |
120 | case -2: | 121 | case -2: |
121 | sprintf(numstring, "[i] That appears to be your own key"); | 122 | sprintf(numstring, "[i] Please add a message to your request."); |
122 | break; | 123 | break; |
123 | case -3: | 124 | case -3: |
124 | sprintf(numstring, "[i] Friend request already sent"); | 125 | sprintf(numstring, "[i] That appears to be your own ID."); |
125 | break; | 126 | break; |
126 | case -4: | 127 | case -4: |
127 | sprintf(numstring, "[i] Could not add friend"); | 128 | sprintf(numstring, "[i] Friend request already sent."); |
128 | break; | 129 | break; |
129 | default: | 130 | case -5: |
130 | sprintf(numstring, "[i] Added friend %d", num); | 131 | sprintf(numstring, "[i] Undefined error when adding friend."); |
131 | break; | 132 | break; |
133 | default: | ||
134 | sprintf(numstring, "[i] Added friend as %d.", num); | ||
135 | break; | ||
132 | } | 136 | } |
133 | new_lines(numstring); | 137 | new_lines(numstring); |
134 | do_refresh(); | 138 | do_refresh(); |