This repository was archived by the owner on Jan 23, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathtwc-chat.h
More file actions
89 lines (70 loc) · 2.57 KB
/
twc-chat.h
File metadata and controls
89 lines (70 loc) · 2.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/*
* Copyright (c) 2018 Håvard Pettersson <mail@haavard.me>
*
* 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>
#include <stdint.h>
struct t_twc_list;
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;
int32_t group_number;
struct t_gui_nick_group *nicklist_group;
struct t_weelist *nicks;
struct t_weelist *ids;
struct t_weelist *completion;
char *last_search;
char *prev_comp;
};
struct t_twc_chat *
twc_chat_search_friend(struct t_twc_profile *profile, int32_t friend_number,
bool create_new);
struct t_twc_chat *
twc_chat_search_group(struct t_twc_profile *profile, int32_t group_number,
bool create_new);
struct t_twc_chat *
twc_chat_search_buffer(struct t_gui_buffer *target_buffer);
void
twc_chat_update_prefix(struct t_twc_chat *chat, const char *id,
const char *prefix, const char *prefix_color);
void
twc_chat_update_prefix_by_nick(struct t_gui_buffer *buffer,
struct t_gui_nick *nick, const char *prefix,
const char *prefix_color);
enum t_twc_rc
twc_chat_set_logging(struct t_twc_chat const *const chat, bool logging);
void
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);
void
twc_chat_send_message(struct t_twc_chat *chat, const char *message,
TOX_MESSAGE_TYPE message_type);
void
twc_chat_queue_refresh(struct t_twc_chat *chat);
void
twc_chat_free(struct t_twc_chat *chat);
void
twc_chat_free_list(struct t_twc_list *list);
#endif /* TOX_WEECHAT_CHAT_H */