2
0
mirror of https://github.com/ars3niy/tdlib-purple synced 2025-08-29 13:07:39 +00:00

117 Commits

Author SHA1 Message Date
Arseniy Lartsev
42f2441764 Show list of members in basic groups 2020-05-11 19:44:46 +02:00
Arseniy Lartsev
b34d10d242 Don't use td::td_api::downcast_call
It needs this member function with auto argument thing, which requires
-fconcepts flag to compile with newer gcc. Rather than have such
problems, just don't use this syntax.
2020-05-10 16:32:13 +02:00
Arseniy Lartsev
8cda4074b9 Support sending messages to group chats 2020-05-10 14:24:15 +02:00
Arseniy Lartsev
db1ee736f6 Added test case for incoming group chat message at login 2020-05-10 13:01:57 +02:00
Arseniy Lartsev
368dff17ad Create conversation window when "joining" a chat
This works for groups we are already member of (these will be in the
contact list)
2020-05-10 12:19:19 +02:00
Arseniy Lartsev
29097c5ac4 Show photos in group chats (plus test case) 2020-05-09 20:48:31 +02:00
Arseniy Lartsev
deb5b14046 Added test for receiving messages in basic group 2020-05-09 19:46:02 +02:00
Arseniy Lartsev
75a1f01358 Implemented receiving group chat messages 2020-05-09 18:58:04 +02:00
Arseniy Lartsev
aa2db8ac20 Removed some obsolete comments and log messages 2020-05-09 15:22:49 +02:00
Arseniy Lartsev
2e998560e3 Create libpurple chats for group chats at login 2020-05-09 15:13:49 +02:00
Arseniy Lartsev
e9390f91fd Create libpurple chats if we get added to groups while online 2020-05-09 14:53:48 +02:00
Arseniy Lartsev
27709bdf66 Go back to not adding buddies until connected
purple_blist_find_chat doesn't work on non-connected accounts, so just
in case, don't use purple_find_buddy either when not connected
2020-05-09 13:58:54 +02:00
Arseniy Lartsev
7b85148cda More straightforward handling of updateNewChat
Add libpurple buddies as soon as updateNewChat has arrived and phone
number is known, regardles of whether it happens at login or later while
online.
2020-05-08 19:50:55 +02:00
Arseniy Lartsev
b76219c12d Added support for receiving photos (kind of)
Pidgin shows them as clickable URLs, and on my systems, opens them with
konqueror of all things. But guess that's good enough.
2020-05-08 17:01:12 +02:00
Arseniy Lartsev
5f893255f7 Added test for some messages other than text and photo 2020-05-08 15:03:35 +02:00
Arseniy Lartsev
d682a2d4c5 Notify about all other message types as well 2020-05-08 13:22:21 +02:00
Arseniy Lartsev
a62647aed8 Notify about videos too, and refactored code there 2020-05-08 13:10:51 +02:00
Arseniy Lartsev
4717c76d35 Mention photos and files in messages (pending real support) 2020-05-07 21:44:51 +02:00
Arseniy Lartsev
c234b8e494 Aded more paranoid null checks 2020-05-07 21:44:45 +02:00
Arseniy Lartsev
af94d3b765 Verify libpurple actions in tests 2020-05-07 13:55:48 +02:00
Arseniy Lartsev
f6ed516f8d Small tweaks 2020-05-07 00:14:45 +02:00
Arseniy Lartsev
df08fa12f9 Added a real test case with login sequence 2020-05-06 20:22:09 +02:00
Arseniy Lartsev
29ed9fa6a4 Added test framework 2020-05-06 14:00:42 +02:00
Arseniy Lartsev
142b42e3f2 Fixed glitches when getting messaged by someone new (untested)
When a new user adds us to their contact list, we get their information,
their online status and their first message before we know their phone
number. Correctly handle this situation and add them to contact list
after a message is received and their phone number becomes known.
2020-05-05 20:19:40 +02:00
Arseniy Lartsev
aea4305867 Collected all phone-number-related functions in one place 2020-05-04 17:32:33 +02:00
Arseniy Lartsev
5b0bacda99 Completely finished adding contacts 2020-05-04 17:16:13 +02:00
Arseniy Lartsev
827410d7fd Fixed all possible contact duplication
When adding a contact with phone number starting with +, telegram will
report phone number without + in subsequent communication. To avoid
problems, always remove leading + before using phone number as libpurple
buddy name.
2020-05-04 17:07:53 +02:00
Arseniy Lartsev
f813f4d8ba Added comment about auto-removing contacts 2020-05-04 16:21:50 +02:00
Arseniy Lartsev
00cef86071 Revert "Prevent contact duplication in some theoretical situation"
This reverts commit d50c766562bb55f2fe11de8b13469bc865455851.
2020-05-04 16:20:47 +02:00
Arseniy Lartsev
d50c766562 Prevent contact duplication in some theoretical situation
In any case, make sure to equate phone numbers with and without leading
plus
2020-05-04 16:20:43 +02:00
Arseniy Lartsev
a2e5bba5ff Correctly log getContacts response 2020-05-04 16:20:43 +02:00
Arseniy Lartsev
22e18cd8ec Refactored adding/renaming libpurple buddies at login
Same function could now be called for post-login updates, though there
does not seem to be any need for that at the moment
2020-05-04 14:08:57 +02:00
Arseniy Lartsev
1b0f8f0e32 More correct handling of responses when creating private chats at login
For successful response, this didn't really matter except for log
message, because the new chat was getting added anyway. For a failed
response, there would be invalid pointer cast and all kinds of problems.
2020-05-04 13:37:02 +02:00
Arseniy Lartsev
3c835bb06f Replaced all function-specific idle callbacks with straight calls
Everything outside of TdTransceiver is now single-threaded, so there is
no longer any need for these idle callbacks
2020-05-02 13:40:48 +02:00
Arseniy Lartsev
eccb0096c5 Removed account data mutex
Everything outside TdTransceiver is now single-threaded so the mutex is
no longer needed
2020-05-02 12:57:48 +02:00
Arseniy Lartsev
aa9bba1f93 Refactored handling of incoming responses and updates
Added RX queue, making it the only data structure needing mutex protection,
and moved it together with all thread-related code into separate class
2020-05-02 12:53:01 +02:00
Arseniy Lartsev
de9163a7ea Create/request private chats for contacts without chat history
Upon login, tdlib will not inform of private chats for contacts without
chat history, thus private chats need to be "created" (with "return
existing if already exists" logic in tdlib) explicitly
2020-05-02 12:42:47 +02:00
Arseniy Lartsev
d7ba8d712b Request information about all contacts from server after connecting
This way, user IDs for contacts with whom there is no chat history
(and thus which are not included in response to getChats) will be known
2020-03-25 16:49:26 +01:00
Arseniy Lartsev
4186b9fdcf Finished adding contact - should be possible to message it right after
But not possible to message after restarting the messenger without
having message prior to restart
2020-03-24 00:14:19 +01:00
Arseniy Lartsev
9bf417ad2e First steps of correct contact addition procedure 2020-03-23 22:56:16 +01:00
Arseniy Lartsev
29d57d05bb Maybe implemented adding contacts
At least, handle failure when it fails
2020-03-21 14:34:45 +01:00
Arseniy Lartsev
3b0686a5bf Maybe finished remote typing notifications in private chats 2020-03-21 14:34:34 +01:00
Arseniy Lartsev
1ae80cd8c2 Started implementing typing notifications from peers
Waiting until someone talks to me now
2020-03-15 21:50:16 +01:00
Arseniy Lartsev
02026dd630 Properly display outgoing messages 2020-03-08 23:46:12 +01:00
Arseniy Lartsev
2cacaeba62 Rename buddies in contact list at login if they've renamed 2020-03-08 23:46:12 +01:00
Arseniy Lartsev
a9faaa7e6c Set local alias for the libpurple account to "firt-name last-name"
This is done only upon login for now
2020-03-08 23:46:10 +01:00
Arseniy Lartsev
c579baefec More properly report connection state to libpurple 2020-02-29 15:30:24 +01:00
Arseniy Lartsev
82f389b9fe Tried to implement user status updates 2020-02-27 22:27:56 +01:00
Arseniy Lartsev
9c73cb085b Implemented sending messages to private chats 2020-02-27 21:53:56 +01:00
Arseniy Lartsev
04f429dd53 Ditched chats history requests
tdlib notifies about accumulated unread messages same as it
does about messages coming while online
2020-02-27 21:17:02 +01:00