Michael Vetter
015c5d83d0
db: get last messages sorted by timestamp
2020-04-06 19:15:06 +02:00
Michael Vetter
3b2976c9cb
db: Use type from message struct instead of having individual functions
2020-04-06 19:15:06 +02:00
Michael Vetter
3524a53c7c
Add type field to ProfMessage
...
The mucuser boolean is not now needed anymore.
2020-04-06 19:15:02 +02:00
Michael Vetter
5862e5b159
db: Fix memleaks
2020-04-06 16:09:38 +02:00
Michael Vetter
1afb708533
Add sql to error log
...
so we can more easily grep for it.
2020-04-06 15:55:22 +02:00
Michael Vetter
bd116e6ad9
win_print_history() print 'me' on regular chats if we wrote the message
...
Same behaviour like when we used to get it from the text files.
2020-04-06 15:48:23 +02:00
Michael Vetter
067bc690f2
Adapt win_print_history() to work with muc too
2020-04-06 15:33:01 +02:00
Michael Vetter
0942d98c61
Remove chat_log_get_previous()
...
We now dont get the log files from the text files via chat_log_get_previous() anymore.
We use the sql backend via log_database_get_previous_chat().
So far it just has the same behaviour like chat_log_get_previous(),
except that in _chatwin_history() we don't pass the sender to
win_print_history() which should be fixed in a commit soon.
And log_database_get_previous_chat() can later easily be expanded to fix
https://github.com/profanity-im/profanity/issues/205 .
2020-04-06 14:42:52 +02:00
Michael Vetter
5d54bb228f
Get regular chat history out of sql backend
2020-04-06 14:30:38 +02:00
Michael Vetter
20850eb4db
db: log encryption type
2020-04-06 10:50:20 +02:00
Michael Vetter
9b1aac0481
db: log "to" resource
2020-04-06 10:50:20 +02:00
Michael Vetter
db502d7054
db: log "from" resource
2020-04-06 10:50:20 +02:00
Michael Vetter
9224331df3
Fix copy paste error
2020-04-06 10:50:20 +02:00
Michael Vetter
4cc8df5929
Add log_database_add_*() test stubs
2020-04-06 10:50:20 +02:00
Michael Vetter
6803fb5c3a
Fix message_send_private unittest stub
2020-04-06 10:50:20 +02:00
Michael Vetter
58bef8e592
db: dont log reflected MUC messages
2020-04-06 10:50:20 +02:00
Michael Vetter
a0a4fd0426
db: log all incoming and outgoing messages
2020-04-06 10:50:20 +02:00
Michael Vetter
def2123216
db: log outgoing message in one case
...
Not all cases covered yet.
2020-04-06 10:50:20 +02:00
Michael Vetter
628b86f57e
db: add dedicated chat, muc, muc pm logging functions
2020-04-06 10:50:20 +02:00
Michael Vetter
a4b53550ca
Rename PROF_MSG_ENC_PLAIN to PROF_MSG_ENC_NONE
2020-04-06 10:50:20 +02:00
Michael Vetter
af2630a289
db: insert message type
2020-04-06 10:50:20 +02:00
Michael Vetter
9278ba775b
db: add more needed fields
...
DB fields should be complete now.
2020-04-06 10:50:20 +02:00
Michael Vetter
fe67102e71
db: make id autoincrement
2020-04-06 10:50:20 +02:00
Michael Vetter
c56443fea5
db: fix inserting null in database
2020-04-06 10:50:20 +02:00
Michael Vetter
dc0b7b5e91
db: log replace id
2020-04-06 10:50:20 +02:00
Michael Vetter
a5a53c52de
db: use goto in error case
2020-04-06 10:50:20 +02:00
Michael Vetter
ac6a1222fc
db: add db version
...
so we can later migrate.
2020-04-06 10:50:20 +02:00
Michael Vetter
062c7b1a89
db: add database unit test stub
2020-04-06 10:50:20 +02:00
Michael Vetter
4a7a0f3e76
db: move includes
2020-04-06 10:50:20 +02:00
Michael Vetter
1155963c6c
db: guard against no DB
...
Maybe if we only use `/connect` we dont have ProfAccount. In that case
we won't log anything. Only if a account is used we log.
If this is the case or the init of the db didn't work we still want
profanity to run but wont log anything to the db.
2020-04-06 10:50:20 +02:00
Michael Vetter
11663625cc
db: Have one database per account
2020-04-06 10:50:20 +02:00
Michael Vetter
672f3e22e8
Add sqlite to CI dependencies
2020-04-06 10:50:20 +02:00
Michael Vetter
71e872c5b8
database: dont log muc pms
2020-04-06 10:50:20 +02:00
Michael Vetter
5cc3b469a8
database: log stanza_id and whether it is a muc message
2020-04-06 10:50:20 +02:00
Michael Vetter
d1d0ad8d1a
Add timestamp for incoming messages if none is set
...
Timestamps are only set if a message is delayed.
If none is set let's set it upon recaival so we don't have to set it
when it gets displayed.
This means we will also have it for logs etc in the ProfMessage.
2020-04-06 10:50:20 +02:00
Michael Vetter
8045a32c4a
database: log incoming messages
...
First trial. Not covering all cases yet.
2020-04-06 10:50:20 +02:00
Michael Vetter
a7163b24f3
database: Define chatlog database location
2020-04-06 10:50:20 +02:00
Michael Vetter
994411d470
database: create table
2020-04-06 10:50:20 +02:00
Michael Vetter
8bfb175d03
Start SQLite db module
...
I plan to save all messages in an SQLite db.
For retrieving information it's nicer than having it in a text file.
We will have more info in there and easier to parse it.
This will also be good for later MAM
(https://github.com/profanity-im/profanity/issues/660 ).
Regular text files will still be an option for users so that they can
easily grep them and do whatever they like.
Internally Profanity will only use the SQLite db.
2020-04-06 10:50:20 +02:00
Michael Vetter
49057077b9
Merge pull request #1299 from profanity-im/memleaks
...
Fix few memory leaks
2020-04-06 10:39:32 +02:00
Dmitry Podgorny
42b6d78a70
Fix multiple memory leaks related to rosterwin_roster()
...
There are multiple paths which lead to rosterwin_roster(). The function
doesn't free list returned by wins_get_private_chats().
2020-04-06 14:29:21 +03:00
Dmitry Podgorny
ba291a03f4
Fix memory leak in cons_show_disco_info()
2020-04-06 13:29:36 +03:00
Michael Vetter
eb2165e0a4
Merge pull request #1298 from profanity-im/memleaks
...
Fix few memory leaks
2020-04-05 19:57:56 +02:00
Dmitry Podgorny
ded48a7e40
Fix memory leak in stanza_attach_correction()
...
xmpp_stanza_add_child() takes own reference to the child stanza.
Therefore we have to release our reference or the child is lost
and not freed otherwise.
2020-04-05 15:58:28 +03:00
Dmitry Podgorny
dc5ddb8ebe
Fix memory leak in _rosterwin_resources()
2020-04-05 15:57:27 +03:00
Michael Vetter
23d79e6eac
readme: add repos and urls
2020-04-05 00:13:38 +02:00
Michael Vetter
63b996a3b6
Add blog to readme
...
Many people seem to miss because they check only github and not the
website.
2020-04-05 00:10:43 +02:00
Michael Vetter
1cd9bfd2e7
Dont have account otr setting if built without otr
2020-04-03 01:37:25 +02:00
Michael Vetter
fd19b45a37
Merge pull request #1297 from profanity-im/memleak-mucwin
...
Fixed memory leak in ProfMucWin
2020-04-03 00:11:12 +02:00
Dmitry Podgorny
37c200571f
Fixed memory leak in ProfMucWin
...
Profanity remembers last message and its id for the message correction
feature. We must free them in window destructor.
2020-04-03 01:47:38 +03:00