Commit fa26c2b6 authored by Vincent Castellano's avatar Vincent Castellano

Completed initial tgl_Peer type implementation

parent d6dec6f8
......@@ -24,7 +24,6 @@
#ifdef USE_PYTHON
#include "python-tg.h"
#include "python-types.h"
#endif
#include <string.h>
......@@ -74,6 +73,11 @@
// Python Imports
#include "datetime.h"
// Custom Types
#include "python-types.h"
//#include "interface.h"
//#include "auto/constants.h"
#include <tgl/tgl.h>
......@@ -269,7 +273,7 @@ PyObject* get_update_types (unsigned flags) {
PyObject* get_peer (tgl_peer_id_t id, tgl_peer_t *P) {
PyObject *peer;
/*
peer = PyDict_New();
if(peer == NULL)
assert(0); // TODO handle python exception;
......@@ -320,7 +324,9 @@ PyObject* get_peer (tgl_peer_id_t id, tgl_peer_t *P) {
}
PyDict_SetItemString (peer, "peer", peer_obj);
}
*/
peer = tgl_Peer_FromTglPeer(P);
return peer;
}
......
This diff is collapsed.
......@@ -31,6 +31,13 @@ def history_cb(msg_list, ptype, pid, success, msgs):
if len(msgs) == HISTORY_QUERY_SIZE:
tgl.get_history(ptype, pid, len(msg_list), HISTORY_QUERY_SIZE, partial(history_cb, msg_list, ptype, pid));
def on_msg_receive(msg):
if msg["out"] and not binlog_done:
return;
print(msg["to"].user_id)
"""
def on_msg_receive(msg):
if msg["out"] and not binlog_done:
return;
......@@ -53,7 +60,7 @@ def on_msg_receive(msg):
if text.startswith("!loadhistory"):
msg_list = []
tgl.get_history_ext(ptype, pid, 0, HISTORY_QUERY_SIZE, partial(history_cb, msg_list, ptype, pid));
"""
def on_secret_chat_update(peer, types):
return "on_secret_chat_update"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment