mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Merge branch 'master' of https://github.com/irungentoo/ProjectTox-Core
This commit is contained in:
commit
5a5e6fd307
17
INSTALL.md
17
INSTALL.md
|
@ -27,6 +27,23 @@ For example, to build [`Messenger_test.c`](/others/Messenger_test.c) you would r
|
||||||
make Messenger_test
|
make Messenger_test
|
||||||
```
|
```
|
||||||
|
|
||||||
|
###OSX:
|
||||||
|
|
||||||
|
Much the same as above, remember to install the latest XCode and the developer tools (Preferences -> Downloads -> Command Line Tools).
|
||||||
|
Users running Mountain Lion and the latest version of XCode (4.6.3) will also need to install libtool
|
||||||
|
Libtool is easy enough to install, grab it from http://www.gnu.org/software/libtool/ and:
|
||||||
|
|
||||||
|
./configure
|
||||||
|
make
|
||||||
|
sudo make install
|
||||||
|
|
||||||
|
Do not install it from macports (or any dependencies for that matter) as they get shoved in the wrong directory
|
||||||
|
and make your life more annoying.
|
||||||
|
|
||||||
|
Another thing you may want to install is the latest gcc, this caused me a few problems as XCode from 4.3
|
||||||
|
no longer includes gcc and instead uses LLVM-GCC, a nice install guide can be found at
|
||||||
|
http://caiustheory.com/install-gcc-421-apple-build-56663-with-xcode-42
|
||||||
|
|
||||||
###Windows:
|
###Windows:
|
||||||
|
|
||||||
You should install:
|
You should install:
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
#include "nTox.h"
|
#include "nTox.h"
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#define c_sleep(x) Sleep(1*x)
|
#define c_sleep(x) Sleep(1*x)
|
||||||
|
@ -168,12 +170,12 @@ void do_refresh()
|
||||||
}
|
}
|
||||||
void print_request(uint8_t * public_key, uint8_t * data, uint16_t length)
|
void print_request(uint8_t * public_key, uint8_t * data, uint16_t length)
|
||||||
{
|
{
|
||||||
new_lines("Friend request");
|
new_lines("[i] received friend request");
|
||||||
do_refresh();
|
do_refresh();
|
||||||
if(memcmp(data , "Install Gentoo", sizeof("Install Gentoo")) == 0 )
|
if(memcmp(data , "Install Gentoo", sizeof("Install Gentoo")) == 0 )
|
||||||
//if the request contained the message of peace the person is obviously a friend so we add him.
|
//if the request contained the message of peace the person is obviously a friend so we add him.
|
||||||
{
|
{
|
||||||
new_lines("[i] friend request accepted.");
|
new_lines("[i] friend request accepted");
|
||||||
do_refresh();
|
do_refresh();
|
||||||
int num = m_addfriend_norequest(public_key);
|
int num = m_addfriend_norequest(public_key);
|
||||||
char numchar[100];
|
char numchar[100];
|
||||||
|
@ -186,7 +188,11 @@ void print_message(int friendnumber, uint8_t * string, uint16_t length)
|
||||||
char *name = malloc(MAX_NAME_LENGTH);
|
char *name = malloc(MAX_NAME_LENGTH);
|
||||||
getname(friendnumber, (uint8_t*)name);
|
getname(friendnumber, (uint8_t*)name);
|
||||||
char msg[100+length+strlen(name)+1];
|
char msg[100+length+strlen(name)+1];
|
||||||
sprintf(msg, "[%d] <%s> %s", friendnumber, name, string);
|
time_t rawtime;
|
||||||
|
struct tm * timeinfo;
|
||||||
|
time ( &rawtime );
|
||||||
|
timeinfo = localtime ( &rawtime );
|
||||||
|
sprintf(msg, "[%d] %s <%s> %s", friendnumber, asctime (timeinfo), name, string); // someone please fix this
|
||||||
free(name);
|
free(name);
|
||||||
new_lines(msg);
|
new_lines(msg);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user