weechat-xmpp/slack-channel.h

130 lines
3.5 KiB
C
Raw Normal View History

2018-05-02 07:11:57 +00:00
#ifndef _SLACK_CHANNEL_H_
#define _SLACK_CHANNEL_H_
2018-05-02 22:16:20 +00:00
#define SLACK_CHANNEL_NAME_MAX_LEN 22
2018-05-02 07:11:57 +00:00
enum t_slack_channel_type
{
SLACK_CHANNEL_TYPE_CHANNEL,
SLACK_CHANNEL_TYPE_GROUP,
SLACK_CHANNEL_TYPE_MPIM,
SLACK_CHANNEL_TYPE_IM,
};
2018-05-06 00:09:58 +00:00
struct t_slack_channel_typing
{
char *id;
char *name;
2018-05-06 20:21:48 +00:00
time_t ts;
2018-05-06 00:09:58 +00:00
struct t_slack_channel_typing *prev_typing;
struct t_slack_channel_typing *next_typing;
};
2018-05-02 07:11:57 +00:00
struct t_slack_channel_member
{
char *id;
struct t_slack_channel_member *prev_member;
struct t_slack_channel_member *next_member;
};
struct t_slack_channel_topic
{
char *value;
char *creator;
2018-05-06 20:21:48 +00:00
time_t last_set;
2018-05-02 07:11:57 +00:00
};
struct t_slack_channel_purpose
{
char *value;
char *creator;
2018-05-06 20:21:48 +00:00
time_t last_set;
2018-05-02 07:11:57 +00:00
};
struct t_slack_channel
{
enum t_slack_channel_type type;
char *id;
char *name;
2018-05-06 20:21:48 +00:00
time_t created;
2018-05-02 07:11:57 +00:00
/* channel */
int is_general;
char *name_normalized;
int is_shared;
int is_org_shared;
int is_member;
/* group */
struct t_slack_channel_topic topic;
struct t_slack_channel_purpose purpose;
int is_archived;
/* mpim */
char *creator;
double last_read;
int unread_count;
int unread_count_display;
/* im */
int is_user_deleted;
2018-05-06 00:09:58 +00:00
struct t_hook *typing_hook_timer;
struct t_slack_channel_typing *typings;
struct t_slack_channel_typing *last_typing;
2018-05-02 07:11:57 +00:00
struct t_slack_channel_member *members;
struct t_slack_channel_member *last_member;
struct t_gui_buffer *buffer;
char *buffer_as_string;
struct t_slack_channel *prev_channel;
struct t_slack_channel *next_channel;
};
struct t_slack_channel *slack_channel_search(struct t_slack_workspace *workspace,
const char *id);
2018-05-02 15:55:41 +00:00
void slack_channel_add_nicklist_groups(struct t_slack_workspace *workspace,
struct t_slack_channel *channel);
2018-05-02 07:11:57 +00:00
struct t_slack_channel *slack_channel_new(struct t_slack_workspace *workspace,
enum t_slack_channel_type type,
const char *id, const char *name);
2018-05-06 00:09:58 +00:00
void slack_channel_typing_free(struct t_slack_channel *channel,
struct t_slack_channel_typing *typing);
void slack_channel_typing_free_all(struct t_slack_channel *channel);
int slack_channel_typing_cb(const void *pointer,
void *data,
int remaining_calls);
struct t_slack_channel_typing *slack_channel_typing_search(
struct t_slack_channel *channel,
const char *id);
void slack_channel_add_typing(struct t_slack_channel *channel,
struct t_slack_user *user);
2018-05-02 15:55:41 +00:00
void slack_channel_free_all(struct t_slack_workspace *workspace);
2018-05-02 07:11:57 +00:00
2018-05-06 13:45:37 +00:00
void slack_channel_update_topic(struct t_slack_channel *channel,
const char* title,
const char* creator,
int last_set);
void slack_channel_update_purpose(struct t_slack_channel *channel,
const char* purpose,
const char* creator,
int last_set);
2018-05-07 17:08:34 +00:00
struct t_slack_channel_member *slack_channel_add_member(
struct t_slack_workspace *workspace,
struct t_slack_channel *channel,
const char *id);
2018-05-02 07:11:57 +00:00
#endif /*SLACK_CHANNEL_H*/