2014-09-28 03:29:34 +02:00
|
|
|
/*
|
2018-04-12 23:42:34 +02:00
|
|
|
* Copyright (c) 2018 Håvard Pettersson <mail@haavard.me>
|
2014-09-28 03:29:34 +02:00
|
|
|
*
|
|
|
|
* This file is part of Tox-WeeChat.
|
|
|
|
*
|
|
|
|
* Tox-WeeChat is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* Tox-WeeChat is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with Tox-WeeChat. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef TOX_WEECHAT_CHAT_H
|
|
|
|
#define TOX_WEECHAT_CHAT_H
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
2017-02-11 04:08:26 +01:00
|
|
|
#include <stdint.h>
|
2014-09-28 03:29:34 +02:00
|
|
|
|
2014-10-05 05:22:59 +02:00
|
|
|
struct t_twc_list;
|
|
|
|
|
2014-09-28 03:29:34 +02:00
|
|
|
extern const char *twc_tag_unsent_message;
|
|
|
|
extern const char *twc_tag_sent_message;
|
|
|
|
extern const char *twc_tag_received_message;
|
|
|
|
|
|
|
|
struct t_twc_chat
|
|
|
|
{
|
|
|
|
struct t_twc_profile *profile;
|
|
|
|
|
|
|
|
struct t_gui_buffer *buffer;
|
|
|
|
int32_t friend_number;
|
2014-10-04 20:57:29 +02:00
|
|
|
int32_t group_number;
|
2014-10-05 05:22:59 +02:00
|
|
|
|
|
|
|
struct t_gui_nick_group *nicklist_group;
|
2017-01-03 13:41:35 +01:00
|
|
|
struct t_weelist *nicks;
|
2014-09-28 03:29:34 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
struct t_twc_chat *
|
2017-02-11 04:08:26 +01:00
|
|
|
twc_chat_search_friend(struct t_twc_profile *profile, int32_t friend_number,
|
|
|
|
bool create_new);
|
2014-09-28 03:29:34 +02:00
|
|
|
|
2014-10-04 20:57:29 +02:00
|
|
|
struct t_twc_chat *
|
2017-02-11 04:08:26 +01:00
|
|
|
twc_chat_search_group(struct t_twc_profile *profile, int32_t group_number,
|
|
|
|
bool create_new);
|
2014-10-04 20:57:29 +02:00
|
|
|
|
2014-09-28 03:29:34 +02:00
|
|
|
struct t_twc_chat *
|
|
|
|
twc_chat_search_buffer(struct t_gui_buffer *target_buffer);
|
|
|
|
|
2017-02-09 08:15:12 +01:00
|
|
|
enum t_twc_rc
|
|
|
|
twc_chat_set_logging(struct t_twc_chat const *const chat, bool logging);
|
|
|
|
|
2014-09-28 03:29:34 +02:00
|
|
|
void
|
2017-02-11 04:08:26 +01:00
|
|
|
twc_chat_print_message(struct t_twc_chat *chat, const char *tags,
|
|
|
|
const char *color, const char *sender,
|
|
|
|
const char *message, TOX_MESSAGE_TYPE message_type);
|
2014-09-28 03:29:34 +02:00
|
|
|
|
|
|
|
void
|
2014-11-19 07:12:41 +01:00
|
|
|
twc_chat_send_message(struct t_twc_chat *chat, const char *message,
|
2016-12-22 13:35:08 +01:00
|
|
|
TOX_MESSAGE_TYPE message_type);
|
2014-09-28 03:29:34 +02:00
|
|
|
|
|
|
|
void
|
|
|
|
twc_chat_queue_refresh(struct t_twc_chat *chat);
|
|
|
|
|
2014-10-05 05:22:59 +02:00
|
|
|
void
|
|
|
|
twc_chat_free(struct t_twc_chat *chat);
|
|
|
|
|
2014-09-28 03:29:34 +02:00
|
|
|
void
|
2014-10-04 21:42:30 +02:00
|
|
|
twc_chat_free_list(struct t_twc_list *list);
|
2014-09-28 03:29:34 +02:00
|
|
|
|
2017-02-11 04:08:26 +01:00
|
|
|
#endif /* TOX_WEECHAT_CHAT_H */
|