Mercurial > ~mikael > mcabber > hg
comparison mcabber/mcabber/xmpp_muc.c @ 1979:6febc7d1f760
Add /room setopt flag_joins (Hermitifier)
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Sat, 26 Mar 2011 14:45:19 +0100 |
parents | 9f443617e96b |
children | 024bdd1c6418 |
comparison
equal
deleted
inserted
replaced
1978:986e514bec97 | 1979:6febc7d1f760 |
---|---|
342 enum room_printstatus printstatus, | 342 enum room_printstatus printstatus, |
343 time_t usttime, int log_muc_conf) | 343 time_t usttime, int log_muc_conf) |
344 { | 344 { |
345 bool new_member = FALSE; // True if somebody else joins the room (not us) | 345 bool new_member = FALSE; // True if somebody else joins the room (not us) |
346 gchar *mbuf; | 346 gchar *mbuf; |
347 enum room_flagjoins flagjoins; | |
347 | 348 |
348 if (!buddy_getinsideroom(room_elt->data)) { | 349 if (!buddy_getinsideroom(room_elt->data)) { |
349 // We weren't inside the room yet. Now we are. | 350 // We weren't inside the room yet. Now we are. |
350 // However, this could be a presence packet from another room member | 351 // However, this could be a presence packet from another room member |
351 | 352 |
383 } | 384 } |
384 } | 385 } |
385 | 386 |
386 if (mbuf) { | 387 if (mbuf) { |
387 guint msgflags = HBB_PREFIX_INFO; | 388 guint msgflags = HBB_PREFIX_INFO; |
388 if (!settings_opt_get_int("muc_flag_joins")) | 389 flagjoins = buddy_getflagjoins(room_elt->data); |
390 if (flagjoins == flagjoins_default && | |
391 !settings_opt_get_int("muc_flag_joins")) | |
392 flagjoins = flagjoins_none; | |
393 if (flagjoins == flagjoins_none) | |
389 msgflags |= HBB_PREFIX_NOFLAG; | 394 msgflags |= HBB_PREFIX_NOFLAG; |
390 scr_WriteIncomingMessage(roomjid, mbuf, usttime, msgflags, 0); | 395 scr_WriteIncomingMessage(roomjid, mbuf, usttime, msgflags, 0); |
391 if (log_muc_conf) | 396 if (log_muc_conf) |
392 hlog_write_message(roomjid, 0, -1, mbuf); | 397 hlog_write_message(roomjid, 0, -1, mbuf); |
393 g_free(mbuf); | 398 g_free(mbuf); |
405 const char *ournick; | 410 const char *ournick; |
406 enum imrole mbrole = role_none; | 411 enum imrole mbrole = role_none; |
407 enum imaffiliation mbaffil = affil_none; | 412 enum imaffiliation mbaffil = affil_none; |
408 enum room_printstatus printstatus; | 413 enum room_printstatus printstatus; |
409 enum room_autowhois autowhois; | 414 enum room_autowhois autowhois; |
415 enum room_flagjoins flagjoins; | |
410 const char *mbjid = NULL, *mbnick = NULL; | 416 const char *mbjid = NULL, *mbnick = NULL; |
411 const char *actorjid = NULL, *reason = NULL; | 417 const char *actorjid = NULL, *reason = NULL; |
412 bool new_member = FALSE; // True if somebody else joins the room (not us) | 418 bool new_member = FALSE; // True if somebody else joins the room (not us) |
413 bool our_presence = FALSE; // True if this presence is from us (i.e. bears | 419 bool our_presence = FALSE; // True if this presence is from us (i.e. bears |
414 // code 110) | 420 // code 110) |
638 | 644 |
639 // Display the mbuf message if we're concerned | 645 // Display the mbuf message if we're concerned |
640 // or if the print_status isn't set to none. | 646 // or if the print_status isn't set to none. |
641 if (our_presence || printstatus != status_none) { | 647 if (our_presence || printstatus != status_none) { |
642 msgflags = HBB_PREFIX_INFO; | 648 msgflags = HBB_PREFIX_INFO; |
643 if (!our_presence && settings_opt_get_int("muc_flag_joins") != 2) | 649 flagjoins = buddy_getflagjoins(room_elt->data); |
650 if (flagjoins == flagjoins_default && | |
651 settings_opt_get_int("muc_flag_joins") == 2) | |
652 flagjoins = flagjoins_all; | |
653 if (!our_presence && flagjoins != flagjoins_all) | |
644 msgflags |= HBB_PREFIX_NOFLAG; | 654 msgflags |= HBB_PREFIX_NOFLAG; |
655 //silent message if someone else joins, and we care about noone | |
645 scr_WriteIncomingMessage(roomjid, mbuf, usttime, msgflags, 0); | 656 scr_WriteIncomingMessage(roomjid, mbuf, usttime, msgflags, 0); |
646 } | 657 } |
647 | 658 |
648 if (log_muc_conf) | 659 if (log_muc_conf) |
649 hlog_write_message(roomjid, 0, -1, mbuf); | 660 hlog_write_message(roomjid, 0, -1, mbuf); |