| 149 switch (status) |
149 switch (status) |
| 150 { |
150 { |
| 151 case PURPLE_CMD_STATUS_OK: |
151 case PURPLE_CMD_STATUS_OK: |
| 152 break; |
152 break; |
| 153 case PURPLE_CMD_STATUS_NOT_FOUND: |
153 case PURPLE_CMD_STATUS_NOT_FOUND: |
| 154 purple_conversation_write(conv, "", _("No such command."), |
154 purple_conversation_write_system_message(conv, |
| 155 PURPLE_MESSAGE_NO_LOG, time(NULL)); |
155 _("No such command."), PURPLE_MESSAGE_NO_LOG); |
| 156 break; |
156 break; |
| 157 case PURPLE_CMD_STATUS_WRONG_ARGS: |
157 case PURPLE_CMD_STATUS_WRONG_ARGS: |
| 158 purple_conversation_write(conv, "", _("Syntax Error: You typed the wrong number of arguments " |
158 purple_conversation_write_system_message(conv, |
| 159 "to that command."), |
159 _("Syntax Error: You typed the wrong " |
| 160 PURPLE_MESSAGE_NO_LOG, time(NULL)); |
160 "number of arguments to that command."), |
| |
161 PURPLE_MESSAGE_NO_LOG); |
| 161 break; |
162 break; |
| 162 case PURPLE_CMD_STATUS_FAILED: |
163 case PURPLE_CMD_STATUS_FAILED: |
| 163 purple_conversation_write(conv, "", error ? error : _("Your command failed for an unknown reason."), |
164 purple_conversation_write_system_message(conv, |
| 164 PURPLE_MESSAGE_NO_LOG, time(NULL)); |
165 error ? error : _("Your command failed for an unknown reason."), |
| |
166 PURPLE_MESSAGE_NO_LOG); |
| 165 break; |
167 break; |
| 166 case PURPLE_CMD_STATUS_WRONG_TYPE: |
168 case PURPLE_CMD_STATUS_WRONG_TYPE: |
| 167 if(PURPLE_IS_IM_CONVERSATION(conv)) |
169 if(PURPLE_IS_IM_CONVERSATION(conv)) |
| 168 purple_conversation_write(conv, "", _("That command only works in chats, not IMs."), |
170 purple_conversation_write_system_message(conv, |
| 169 PURPLE_MESSAGE_NO_LOG, time(NULL)); |
171 _("That command only works in chats, not IMs."), |
| |
172 PURPLE_MESSAGE_NO_LOG); |
| 170 else |
173 else |
| 171 purple_conversation_write(conv, "", _("That command only works in IMs, not chats."), |
174 purple_conversation_write_system_message(conv, |
| 172 PURPLE_MESSAGE_NO_LOG, time(NULL)); |
175 _("That command only works in IMs, not chats."), |
| |
176 PURPLE_MESSAGE_NO_LOG); |
| 173 break; |
177 break; |
| 174 case PURPLE_CMD_STATUS_WRONG_PRPL: |
178 case PURPLE_CMD_STATUS_WRONG_PRPL: |
| 175 purple_conversation_write(conv, "", _("That command doesn't work on this protocol."), |
179 purple_conversation_write_system_message(conv, |
| 176 PURPLE_MESSAGE_NO_LOG, time(NULL)); |
180 _("That command doesn't work on this protocol."), |
| |
181 PURPLE_MESSAGE_NO_LOG); |
| 177 break; |
182 break; |
| 178 } |
183 } |
| 179 g_free(error); |
184 g_free(error); |
| 180 } |
185 } |
| 181 else if (!purple_account_is_connected(purple_conversation_get_account(ggconv->active_conv))) |
186 else if (!purple_account_is_connected(purple_conversation_get_account(ggconv->active_conv))) |
| 182 { |
187 { |
| 183 purple_conversation_write(ggconv->active_conv, "", _("Message was not sent, because you are not signed on."), |
188 purple_conversation_write_system_message(ggconv->active_conv, |
| 184 PURPLE_MESSAGE_ERROR | PURPLE_MESSAGE_NO_LOG, time(NULL)); |
189 _("Message was not sent, because you are not signed on."), |
| |
190 PURPLE_MESSAGE_ERROR | PURPLE_MESSAGE_NO_LOG); |
| 185 } |
191 } |
| 186 else |
192 else |
| 187 { |
193 { |
| 188 char *escape = purple_markup_escape_text((*text == '/' ? text + 1 : text), -1); |
194 char *escape = purple_markup_escape_text((*text == '/' ? text + 1 : text), -1); |
| 189 purple_conversation_send(ggconv->active_conv, escape); |
195 purple_conversation_send(ggconv->active_conv, escape); |
| 369 while (list) { |
375 while (list) { |
| 370 PurpleConversation *conv = list->data; |
376 PurpleConversation *conv = list->data; |
| 371 if (!purple_chat_conversation_has_left(PURPLE_CHAT_CONVERSATION(conv)) && |
377 if (!purple_chat_conversation_has_left(PURPLE_CHAT_CONVERSATION(conv)) && |
| 372 purple_conversation_get_account(conv) == account) { |
378 purple_conversation_get_account(conv) == account) { |
| 373 g_object_set_data(G_OBJECT(conv), "want-to-rejoin", GINT_TO_POINTER(TRUE)); |
379 g_object_set_data(G_OBJECT(conv), "want-to-rejoin", GINT_TO_POINTER(TRUE)); |
| 374 purple_conversation_write(conv, NULL, _("The account has disconnected and you are no " |
380 purple_conversation_write_system_message(conv, |
| 375 "longer in this chat. You will be automatically rejoined in the chat when " |
381 _("The account has disconnected and you are no " |
| 376 "the account reconnects."), |
382 "longer in this chat. You will be automatically rejoined in the chat when " |
| 377 PURPLE_MESSAGE_SYSTEM | PURPLE_MESSAGE_NO_LOG, time(NULL)); |
383 "the account reconnects."), |
| |
384 PURPLE_MESSAGE_NO_LOG); |
| 378 } |
385 } |
| 379 list = list->next; |
386 list = list->next; |
| 380 } |
387 } |
| 381 } |
388 } |
| 382 |
389 |
| 494 /* Xerox */ |
501 /* Xerox */ |
| 495 if (logging) { |
502 if (logging) { |
| 496 /* Enable logging first so the message below can be logged. */ |
503 /* Enable logging first so the message below can be logged. */ |
| 497 purple_conversation_set_logging(conv, TRUE); |
504 purple_conversation_set_logging(conv, TRUE); |
| 498 |
505 |
| 499 purple_conversation_write(conv, NULL, |
506 purple_conversation_write_system_message(conv, |
| 500 _("Logging started. Future messages in this conversation will be logged."), |
507 _("Logging started. Future messages in this " |
| 501 PURPLE_MESSAGE_SYSTEM, time(NULL)); |
508 "conversation will be logged."), 0); |
| 502 } else { |
509 } else { |
| 503 purple_conversation_write(conv, NULL, |
510 purple_conversation_write_system_message(conv, |
| 504 _("Logging stopped. Future messages in this conversation will not be logged."), |
511 _("Logging stopped. Future messages in this " |
| 505 PURPLE_MESSAGE_SYSTEM, time(NULL)); |
512 "conversation will not be logged."), 0); |
| 506 |
513 |
| 507 /* Disable the logging second, so that the above message can be logged. */ |
514 /* Disable the logging second, so that the above message can be logged. */ |
| 508 purple_conversation_set_logging(conv, FALSE); |
515 purple_conversation_set_logging(conv, FALSE); |
| 509 } |
516 } |
| 510 |
517 |
| 1174 if ((str = purple_chat_user_get_alias(chatuser)) == NULL) |
1181 if ((str = purple_chat_user_get_alias(chatuser)) == NULL) |
| 1175 str = purple_chat_user_get_name(chatuser); |
1182 str = purple_chat_user_get_name(chatuser); |
| 1176 g_string_append_printf(string, "[ %s ]", str); |
1183 g_string_append_printf(string, "[ %s ]", str); |
| 1177 } |
1184 } |
| 1178 |
1185 |
| 1179 purple_conversation_write(conv, NULL, string->str, |
1186 purple_conversation_write_system_message( |
| 1180 PURPLE_MESSAGE_SYSTEM, time(NULL)); |
1187 conv, string->str, 0); |
| 1181 g_string_free(string, TRUE); |
1188 g_string_free(string, TRUE); |
| 1182 } |
1189 } |
| 1183 |
1190 |
| 1184 for (; users; users = users->next) |
1191 for (; users; users = users->next) |
| 1185 { |
1192 { |
| 1331 str = g_string_append(str, "(none)"); |
1338 str = g_string_append(str, "(none)"); |
| 1332 } |
1339 } |
| 1333 |
1340 |
| 1334 tmp = g_string_free(str, FALSE); |
1341 tmp = g_string_free(str, FALSE); |
| 1335 } else { |
1342 } else { |
| 1336 purple_conversation_write(conv, NULL, _("Supported debug options are: plugins version"), |
1343 purple_conversation_write_system_message(conv, |
| 1337 PURPLE_MESSAGE_NO_LOG|PURPLE_MESSAGE_ERROR, time(NULL)); |
1344 _("Supported debug options are: plugins version"), |
| |
1345 PURPLE_MESSAGE_NO_LOG | PURPLE_MESSAGE_ERROR); |
| 1338 return PURPLE_CMD_RET_OK; |
1346 return PURPLE_CMD_RET_OK; |
| 1339 } |
1347 } |
| 1340 |
1348 |
| 1341 markup = g_markup_escape_text(tmp, -1); |
1349 markup = g_markup_escape_text(tmp, -1); |
| 1342 purple_conversation_send(conv, markup); |
1350 purple_conversation_send(conv, markup); |