GNUWeeb / GNUWeebBot

High-performance bot Telegram, running on Linux environment, written in C.
GNU General Public License v2.0
13 stars 8 forks source link

Aliwoto dev #11

Closed ALiwoto closed 3 years ago

ALiwoto commented 3 years ago

My changes:

  1. Added the GIF event structure and it's parser functions.
  2. Added chat_sender parameter for all events(in the case message forwarded from an anonymous admin)
  3. Added unit test for GIF event.
ammarfaizi2 commented 3 years ago

Error from clang build

Scanning dependencies of target test_float
[ 79%] Building C object tests/CMakeFiles/test_float.dir/test_float.c.o
[ 79%] Built target test1Formatted
[ 80%] Linking C executable test_float
Scanning dependencies of target test_object_iterator
[ 81%] Building C object tests/CMakeFiles/test_object_iterator.dir/test_object_iterator.c.o
[ 81%] Built target test_float
Scanning dependencies of target test_null
[ 82%] Building C object tests/CMakeFiles/test_null.dir/test_null.c.o
[ 83%] Linking C executable test_object_iterator
[ 85%] Linking C executable test_null
[ 85%] Built target test_object_iterator
Scanning dependencies of target test_json_pointer
[ 86%] Building C object tests/CMakeFiles/test_json_pointer.dir/test_json_pointer.c.o
[ 86%] Built target test_null
Scanning dependencies of target test_double_serializer
[ 87%] Building C object tests/CMakeFiles/test_double_serializer.dir/test_double_serializer.c.o
[ 88%] Linking C executable test_json_pointer
[ 90%] Linking C executable test_double_serializer
[ 90%] Built target test_double_serializer
[ 90%] Built target test_json_pointer
Scanning dependencies of target test_parse
Scanning dependencies of target test_set_serializer
[ 91%] Building C object tests/CMakeFiles/test_parse.dir/test_parse.c.o
[ 92%] Building C object tests/CMakeFiles/test_set_serializer.dir/test_set_serializer.c.o
[ 93%] Linking C executable test_set_serializer
[ 95%] Linking C executable test_parse
[ 95%] Built target test_set_serializer
Scanning dependencies of target test_set_value
[ 96%] Building C object tests/CMakeFiles/test_set_value.dir/test_set_value.c.o
[ 96%] Built target test_parse
Scanning dependencies of target json_parse
[ 97%] Building C object apps/CMakeFiles/json_parse.dir/json_parse.c.o
[ 98%] Linking C executable test_set_value
[100%] Linking C executable json_parse
[100%] Built target test_set_value
[100%] Built target json_parse
   CC        src/gwbot/lib/tg_api/send_message.o
   CC        src/gwbot/lib/arena.o
   CC        src/gwbot/lib/shell.o
   CC        src/gwbot/lib/string.o
   CC        src/gwbot/lib/tg_api.o
   CC        src/gwbot/lib/tg_event.o
In file included from /home/runner/work/GNUWeebBot/GNUWeebBot/src/gwbot/lib/tg_event.c:5:
/home/runner/work/GNUWeebBot/GNUWeebBot/src/gwbot/include/gwbot/lib/tg_event.h:189:21: error: implicit conversion loses integer precision: 'uint64_t' (aka 'unsigned long') to 'uint32_t' (aka 'unsigned int') [-Werror,-Wshorten-64-to-32]
                imdia->duration = json_object_get_uint64(res);
                                ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/runner/work/GNUWeebBot/GNUWeebBot/src/gwbot/lib/tg_event.c:5:
In file included from /home/runner/work/GNUWeebBot/GNUWeebBot/src/gwbot/include/gwbot/lib/tg_event.h:447:
/home/runner/work/GNUWeebBot/GNUWeebBot/src/gwbot/include/gwbot/lib/tg_event/sticker.h:241:49: error: no newline at end of file [-Werror,-Wnewline-eof]
#endif /* #ifdef SUB_TG_EVENT_CIRCULAR_INLINE */
                                                ^
In file included from /home/runner/work/GNUWeebBot/GNUWeebBot/src/gwbot/lib/tg_event.c:5:
In file included from /home/runner/work/GNUWeebBot/GNUWeebBot/src/gwbot/include/gwbot/lib/tg_event.h:448:
/home/runner/work/GNUWeebBot/GNUWeebBot/src/gwbot/include/gwbot/lib/tg_event/gif.h:210:49: error: no newline at end of file [-Werror,-Wnewline-eof]
#endif /* #ifdef SUB_TG_EVENT_CIRCULAR_INLINE */
                                                ^
In file included from /home/runner/work/GNUWeebBot/GNUWeebBot/src/gwbot/lib/tg_event.c:5:
In file included from /home/runner/work/GNUWeebBot/GNUWeebBot/src/gwbot/include/gwbot/lib/tg_event.h:479:
/home/runner/work/GNUWeebBot/GNUWeebBot/src/gwbot/include/gwbot/lib/tg_event/sticker.h:241:49: error: no newline at end of file [-Werror,-Wnewline-eof]
#endif /* #ifdef SUB_TG_EVENT_CIRCULAR_INLINE */
                                                ^
In file included from /home/runner/work/GNUWeebBot/GNUWeebBot/src/gwbot/lib/tg_event.c:5:
In file included from /home/runner/work/GNUWeebBot/GNUWeebBot/src/gwbot/include/gwbot/lib/tg_event.h:480:
/home/runner/work/GNUWeebBot/GNUWeebBot/src/gwbot/include/gwbot/lib/tg_event/gif.h:210:49: error: no newline at end of file [-Werror,-Wnewline-eof]
#endif /* #ifdef SUB_TG_EVENT_CIRCULAR_INLINE */
                                                ^
5 errors generated.
make: *** [/home/runner/work/GNUWeebBot/GNUWeebBot/src/gwbot/lib/Makefile:24: /home/runner/work/GNUWeebBot/GNUWeebBot/src/gwbot/lib/tg_event.o] Error 1
make: *** Waiting for unfinished jobs....
Error: Process completed with exit code 2.
ammarfaizi2 commented 3 years ago

Nice, thank you so much. I am merging this.