Permalink
Browse files

Merge github.com:vysheng/tg

  • Loading branch information...
V V
V V committed Mar 23, 2016
2 parents 443793d + 160231b commit 6547c0b21b977b327b3c5e8142963f4bc246187a
Showing with 14 additions and 6 deletions.
  1. +2 −0 .travis.yml
  2. +12 −6 json-tg.c
@@ -5,6 +5,7 @@ compiler:
- clang
install:
- sudo apt-get update
- sudo apt-get install libconfig8-dev
- sudo apt-get install libreadline6-dev
- sudo apt-get install libssl-dev
@@ -17,3 +18,4 @@ script:
- git submodule update --init --recursive
- ./configure
- make
@@ -36,11 +36,23 @@ void json_pack_peer_type (json_t *res, tgl_peer_id_t id) {
}
}
int str_format_time(long when, char* string)
{
struct tm *tm = localtime ((void *)&when);
return sprintf (string, "%04d-%02d-%02d %02d:%02d:%02d", tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec);
}
void json_pack_user (json_t *res, tgl_peer_t *P) {
if (P->user.first_name) {
assert (json_object_set (res, "first_name", json_string (P->user.first_name)) >= 0);
}
if (P->user.status.when) {
static char s[20];
str_format_time(P->user.status.when, s);
assert (json_object_set (res, "when", json_string (s)) >= 0);
}
if (P->user.last_name) {
assert (json_object_set (res, "last_name", json_string (P->user.last_name)) >= 0);

This comment has been minimized.

@Asumie

Asumie Nov 17, 2017

	+            {% elif analysis.target.file.type == "XML document text" or analysis.info.package == "wsf" or analysis.info.package
}
@@ -470,12 +482,6 @@ json_t *json_pack_read (struct tgl_message *M) {
return res;
}
int str_format_time(long when, char* string)
{
struct tm *tm = localtime ((void *)&when);
return sprintf (string, "%04d-%02d-%02d %02d:%02d:%02d", tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec);
}
json_t *json_pack_user_status (struct tgl_user *U) {
json_t *res = json_object ();
assert (json_object_set (res, "user", json_pack_peer (U->id)) >= 0);

1 comment on commit 6547c0b

@villamarinella

This comment has been minimized.

villamarinella commented on 6547c0b May 8, 2016

Why this simple line in my t1.lua not work?
send_msg (Klaus_Werner, 'pong', ok_cb, false)

telegram should start and send

Please sign in to comment.