Cleanup
This commit is contained in:
parent
ea12251897
commit
dd6031900e
5 changed files with 0 additions and 53 deletions
|
@ -113,24 +113,6 @@ static void tgl_peer_iterator_cb (tgl_peer_t *peer, void *extra) {
|
|||
g_free (users);
|
||||
return;
|
||||
}
|
||||
/*
|
||||
int i = 0;
|
||||
tgl_peer_id_t ids[(int)[tokens count] + 1];
|
||||
ids[i++] = TGL_MK_USER(conn->TLS->our_id);
|
||||
for (NSString *user in tokens) {
|
||||
tgl_peer_t *P = NULL;
|
||||
P = tgl_peer_get_by_name (conn->TLS, [user UTF8String]);
|
||||
if (P) {
|
||||
ids[i++] = P->id;
|
||||
}
|
||||
}
|
||||
const char *subject = [createChatName UTF8String];
|
||||
tgl_do_create_group_chat(conn->TLS, i, ids, subject, (int) strlen(subject),
|
||||
create_group_chat_done_cb, NULL);
|
||||
// TODO: display new chat
|
||||
return;
|
||||
}
|
||||
*/
|
||||
|
||||
NSString *room = [[popupButton_existingChat selectedItem] title];
|
||||
NSDictionary *chatCreationInfo = [NSDictionary
|
||||
|
|
|
@ -680,31 +680,6 @@ static void cancel_group_chat_cb (gpointer data) {
|
|||
free (d);
|
||||
}
|
||||
|
||||
/*
|
||||
static void create_user_list_entry (tgl_peer_t *P, void *extra) {
|
||||
GList **list = extra;
|
||||
if (tgl_get_peer_type (P->id) == TGL_PEER_USER) {
|
||||
*list = g_list_append(*list, P->print_name);
|
||||
}
|
||||
}
|
||||
|
||||
static PurpleRequestField *create_user_list (struct tgl_state *TLS, const char *id, const char *txt, int nullable) {
|
||||
PurpleRequestField *field = purple_request_field_new (id, txt, PURPLE_REQUEST_FIELD_CHOICE);
|
||||
GList *list = NULL;
|
||||
if (nullable) {
|
||||
list = g_list_append (list, "");
|
||||
}
|
||||
tgl_peer_iterator_ex (TLS, create_user_list_entry, &list);
|
||||
list = g_list_sort(list, (GCompareFunc) g_ascii_strcasecmp);
|
||||
while (list) {
|
||||
purple_request_field_choice_add (field, list->data);
|
||||
list = list->next;
|
||||
}
|
||||
g_list_free(list);
|
||||
return field;
|
||||
}
|
||||
*/
|
||||
|
||||
void request_choose_user (struct accept_create_chat_data *data) {
|
||||
struct tgl_state *TLS = data->TLS;
|
||||
connection_data *conn = TLS->ev_base;
|
||||
|
|
|
@ -149,9 +149,7 @@ static void update_secret_chat_handler (struct tgl_state *TLS, struct tgl_secret
|
|||
if (flags & TGL_UPDATE_WORKING || flags & TGL_UPDATE_DELETED) {
|
||||
write_secret_chat_file (TLS);
|
||||
}
|
||||
|
||||
PurpleBuddy *buddy = p2tgl_buddy_find (TLS, U->id);
|
||||
|
||||
if (! (flags & TGL_UPDATE_DELETED)) {
|
||||
if (!buddy) {
|
||||
buddy = p2tgl_buddy_new (TLS, (tgl_peer_t *)U);
|
||||
|
@ -160,7 +158,6 @@ static void update_secret_chat_handler (struct tgl_state *TLS, struct tgl_secret
|
|||
}
|
||||
p2tgl_prpl_got_set_status_mobile (TLS, U->id);
|
||||
}
|
||||
|
||||
if (flags & TGL_UPDATE_REQUESTED && buddy) {
|
||||
connection_data *conn = TLS->ev_base;
|
||||
const char* choice = purple_account_get_string (conn->pa, "accept-secret-chats", "ask");
|
||||
|
@ -170,12 +167,10 @@ static void update_secret_chat_handler (struct tgl_state *TLS, struct tgl_secret
|
|||
request_accept_secret_chat(TLS, U);
|
||||
}
|
||||
}
|
||||
|
||||
if (flags & TGL_UPDATE_CREATED && buddy) {
|
||||
purple_buddy_set_protocol_data (buddy, (gpointer)U);
|
||||
p2tgl_buddy_update (TLS, (tgl_peer_t *)U, flags);
|
||||
}
|
||||
|
||||
if (flags & TGL_UPDATE_DELETED && buddy) {
|
||||
p2tgl_got_im (TLS, U->id, "Secret chat terminated.", PURPLE_MESSAGE_SYSTEM | PURPLE_MESSAGE_WHISPER, time(0));
|
||||
p2tgl_prpl_got_set_status_offline (TLS, U->id);
|
||||
|
|
|
@ -333,7 +333,6 @@ void p2tgl_connection_set_display_name(struct tgl_state *TLS, tgl_peer_t *user)
|
|||
g_free(name);
|
||||
}
|
||||
|
||||
|
||||
void *p2tgl_notify_userinfo(struct tgl_state *TLS, tgl_peer_id_t user, PurpleNotifyUserInfo *user_info, PurpleNotifyCloseCallback cb, gpointer user_data) {
|
||||
char *name = p2tgl_strdup_id(user);
|
||||
void *handle = 0;
|
||||
|
|
|
@ -344,11 +344,9 @@ static void tgp_msg_display (struct tgl_state *TLS, struct tgp_msg_loading *C) {
|
|||
if (M->media.document->flags & TGLDF_STICKER) {
|
||||
assert (C->data);
|
||||
text = tgp_msg_sticker_display (TLS, C->data, &flags);
|
||||
|
||||
} else if (M->media.document->flags & TGLDF_IMAGE) {
|
||||
assert (C->data);
|
||||
text = tgp_msg_photo_display (TLS, C->data, &flags);
|
||||
|
||||
} else {
|
||||
char *who = p2tgl_strdup_id (M->from_id);
|
||||
if (! tgp_our_msg(TLS, M)) {
|
||||
|
@ -362,11 +360,9 @@ static void tgp_msg_display (struct tgl_state *TLS, struct tgp_msg_loading *C) {
|
|||
if (M->media.encr_document->flags & TGLDF_STICKER) {
|
||||
assert (C->data);
|
||||
text = tgp_msg_sticker_display (TLS, C->data, &flags);
|
||||
|
||||
} if (M->media.encr_document->flags & TGLDF_IMAGE) {
|
||||
assert (C->data);
|
||||
text = tgp_msg_photo_display (TLS, C->data, &flags);
|
||||
|
||||
} else {
|
||||
char *who = p2tgl_strdup_id (M->to_id);
|
||||
if (! tgp_our_msg(TLS, M)) {
|
||||
|
|
Loading…
Add table
Reference in a new issue