@@ -645,15 +645,24 @@ void work_update (struct connection *c UU, long long msg_id UU) {
...
@@ -645,15 +645,24 @@ void work_update (struct connection *c UU, long long msg_id UU) {
}
}
}
}
fetch_int();//pts
fetch_int();//pts
print_start();
push_color(COLOR_YELLOW);
printf("%d messages marked as read\n",n);
pop_color();
print_end();
}
}
break;
break;
caseCODE_update_user_typing:
caseCODE_update_user_typing:
{
{
intid=fetch_int();
intid=fetch_int();
unionuser_chat*U=user_chat_get(id);
unionuser_chat*U=user_chat_get(id);
if(U){
print_start();
rprintf(COLOR_YELLOW"User "COLOR_RED"%s %s"COLOR_YELLOW" is typing....\n"COLOR_NORMAL,U->user.first_name,U->user.last_name);
push_color(COLOR_YELLOW);
}
printf("User ");
print_user_name(id,U);
printf(" is typing....\n");
pop_color();
print_end();
}
}
break;
break;
caseCODE_update_chat_user_typing:
caseCODE_update_chat_user_typing:
...
@@ -662,9 +671,15 @@ void work_update (struct connection *c UU, long long msg_id UU) {
...
@@ -662,9 +671,15 @@ void work_update (struct connection *c UU, long long msg_id UU) {
intid=fetch_int();
intid=fetch_int();
unionuser_chat*C=user_chat_get(-chat_id);
unionuser_chat*C=user_chat_get(-chat_id);
unionuser_chat*U=user_chat_get(id);
unionuser_chat*U=user_chat_get(id);
if(U&&C){
print_start();
rprintf(COLOR_YELLOW"User "COLOR_RED"%s %s"COLOR_YELLOW" is typing in chat %s....\n"COLOR_NORMAL,U->user.first_name,U->user.last_name,C->chat.title);
push_color(COLOR_YELLOW);
}
printf("User ");
print_user_name(id,U);
printf(" is typing in chat ");
print_chat_name(-chat_id,C);
printf("....\n");
pop_color();
print_end();
}
}
break;
break;
caseCODE_update_user_status:
caseCODE_update_user_status:
...
@@ -673,7 +688,14 @@ void work_update (struct connection *c UU, long long msg_id UU) {
...
@@ -673,7 +688,14 @@ void work_update (struct connection *c UU, long long msg_id UU) {
unionuser_chat*U=user_chat_get(user_id);
unionuser_chat*U=user_chat_get(user_id);
if(U){
if(U){
fetch_user_status(&U->user.status);
fetch_user_status(&U->user.status);
rprintf(COLOR_YELLOW"User "COLOR_RED"%s %s"COLOR_YELLOW" is now %s\n"COLOR_NORMAL,U->user.first_name,U->user.last_name,(U->user.status.online>0)?"online":"offline");