mirror of
https://github.com/deltachat/deltachat-core.git
synced 2025-10-06 03:50:08 +02:00
Basically show message threads.
This commit is contained in:
parent
4a7216fb0e
commit
6d3e962261
3 changed files with 18 additions and 2 deletions
15
src/main.cpp
15
src/main.cpp
|
@ -232,7 +232,7 @@ int main(int argc, char ** argv)
|
|||
if( chat->m_lastMsg ) {
|
||||
temp = timestamp_to_str(chat->m_lastMsg->m_timestamp);
|
||||
temp2 = str_repeat("=", 77-strlen(temp));
|
||||
printf("%s%s===", temp2, temp);
|
||||
printf("%s%s===\n", temp2, temp);
|
||||
free(temp2);
|
||||
free(temp);
|
||||
}
|
||||
|
@ -278,7 +278,18 @@ int main(int argc, char ** argv)
|
|||
int i, cnt = carray_count(msglist->m_msgs);
|
||||
for( i = 0; i < cnt; i++ ) {
|
||||
MrMsg* msg = (MrMsg*)carray_get(msglist->m_msgs, i);
|
||||
printf("%i\n", (int)msg->m_id);
|
||||
char *temp, *temp2;
|
||||
|
||||
temp = timestamp_to_str(msg->m_timestamp);
|
||||
temp2 = str_repeat(msg->m_fromId==0/*0=self*/? "<" : ">", 79-strlen(temp));
|
||||
printf("%s %s\n", temp2, temp);
|
||||
free(temp2);
|
||||
free(temp);
|
||||
|
||||
temp = safe_strdup(msg->m_msg);
|
||||
mr_shorten_str(temp, 80);
|
||||
printf("%s\n", temp);
|
||||
free(temp);
|
||||
}
|
||||
delete msglist;
|
||||
}
|
||||
|
|
|
@ -392,12 +392,16 @@ void MrImap::WorkingThread()
|
|||
goto WorkingThread_Exit;
|
||||
}
|
||||
|
||||
MrLogInfo("Successfully connected to server.");
|
||||
|
||||
r = mailimap_login(threadval.m_imap, m_loginParam->m_mail_user, m_loginParam->m_mail_pw);
|
||||
if( Mr_is_error(r) ) {
|
||||
MrLogError("could not login");
|
||||
goto WorkingThread_Exit;
|
||||
}
|
||||
|
||||
MrLogInfo("Successfully logged in.");
|
||||
|
||||
// endless look
|
||||
while( 1 )
|
||||
{
|
||||
|
|
|
@ -224,6 +224,7 @@ ImportSpec_Cleanup:
|
|||
bool MrMailbox::Connect()
|
||||
{
|
||||
if( m_imap.IsConnected() ) {
|
||||
MrLogInfo("MrMailbox::Connect(): Already connected or trying to connect.");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue