summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorredwire <redwire@riseup.net>2013-07-21 21:10:44 -0230
committerredwire <redwire@riseup.net>2013-07-21 21:10:44 -0230
commit5a5e6fd307cc75e89ac2b2268ee9bc89d82101eb (patch)
treebd40a98c32bbcb07586c667cb63805576723530a
parent9b634504a647083753f54472151f81906b290f8b (diff)
parentc211e361d29dbbb941a5aeb0c99fb4f30b76ca8f (diff)
Merge branch 'master' of https://github.com/irungentoo/ProjectTox-Core
-rw-r--r--INSTALL.md19
-rw-r--r--testing/nTox.c12
2 files changed, 27 insertions, 4 deletions
diff --git a/INSTALL.md b/INSTALL.md
index b4e28379..97bef179 100644
--- a/INSTALL.md
+++ b/INSTALL.md
@@ -27,6 +27,23 @@ For example, to build [`Messenger_test.c`](/others/Messenger_test.c) you would r
27make Messenger_test 27make Messenger_test
28``` 28```
29 29
30###OSX:
31
32Much the same as above, remember to install the latest XCode and the developer tools (Preferences -> Downloads -> Command Line Tools).
33Users running Mountain Lion and the latest version of XCode (4.6.3) will also need to install libtool
34Libtool is easy enough to install, grab it from http://www.gnu.org/software/libtool/ and:
35
36./configure
37make
38sudo make install
39
40Do not install it from macports (or any dependencies for that matter) as they get shoved in the wrong directory
41and make your life more annoying.
42
43Another thing you may want to install is the latest gcc, this caused me a few problems as XCode from 4.3
44no longer includes gcc and instead uses LLVM-GCC, a nice install guide can be found at
45http://caiustheory.com/install-gcc-421-apple-build-56663-with-xcode-42
46
30###Windows: 47###Windows:
31 48
32You should install: 49You should install:
@@ -49,4 +66,4 @@ mingw32-make name_of_c_file
49For example, to build [`Messenger_test.c`](/others/Messenger_test.c) you would run: 66For example, to build [`Messenger_test.c`](/others/Messenger_test.c) you would run:
50```cmd 67```cmd
51mingw32-make Messenger_test 68mingw32-make Messenger_test
52``` \ No newline at end of file 69```
diff --git a/testing/nTox.c b/testing/nTox.c
index ccb11a71..693e64aa 100644
--- a/testing/nTox.c
+++ b/testing/nTox.c
@@ -1,4 +1,6 @@
1#include "nTox.h" 1#include "nTox.h"
2#include <stdio.h>
3#include <time.h>
2 4
3#ifdef WIN32 5#ifdef WIN32
4#define c_sleep(x) Sleep(1*x) 6#define c_sleep(x) Sleep(1*x)
@@ -168,12 +170,12 @@ void do_refresh()
168} 170}
169void print_request(uint8_t * public_key, uint8_t * data, uint16_t length) 171void print_request(uint8_t * public_key, uint8_t * data, uint16_t length)
170{ 172{
171 new_lines("Friend request"); 173 new_lines("[i] received friend request");
172 do_refresh(); 174 do_refresh();
173 if(memcmp(data , "Install Gentoo", sizeof("Install Gentoo")) == 0 ) 175 if(memcmp(data , "Install Gentoo", sizeof("Install Gentoo")) == 0 )
174 //if the request contained the message of peace the person is obviously a friend so we add him. 176 //if the request contained the message of peace the person is obviously a friend so we add him.
175 { 177 {
176 new_lines("[i] friend request accepted."); 178 new_lines("[i] friend request accepted");
177 do_refresh(); 179 do_refresh();
178 int num = m_addfriend_norequest(public_key); 180 int num = m_addfriend_norequest(public_key);
179 char numchar[100]; 181 char numchar[100];
@@ -186,7 +188,11 @@ void print_message(int friendnumber, uint8_t * string, uint16_t length)
186 char *name = malloc(MAX_NAME_LENGTH); 188 char *name = malloc(MAX_NAME_LENGTH);
187 getname(friendnumber, (uint8_t*)name); 189 getname(friendnumber, (uint8_t*)name);
188 char msg[100+length+strlen(name)+1]; 190 char msg[100+length+strlen(name)+1];
189 sprintf(msg, "[%d] <%s> %s", friendnumber, name, string); 191 time_t rawtime;
192 struct tm * timeinfo;
193 time ( &rawtime );
194 timeinfo = localtime ( &rawtime );
195 sprintf(msg, "[%d] %s <%s> %s", friendnumber, asctime (timeinfo), name, string); // someone please fix this
190 free(name); 196 free(name);
191 new_lines(msg); 197 new_lines(msg);
192} 198}