comparison mcabber/src/screen.c @ 480:882e1acae422

Add /say_to command
author Mikael Berthe <mikael@lilotux.net>
date Tue, 04 Oct 2005 19:47:50 +0200
parents e4840b288be0
children baa812f04f24
comparison
equal deleted inserted replaced
479:b82428ac107d 480:882e1acae422
775 top_panel(inputPanel); 775 top_panel(inputPanel);
776 update_panels(); 776 update_panels();
777 doupdate(); 777 doupdate();
778 } 778 }
779 779
780 void scr_WriteMessage(const char *jid, const char *text, time_t timestamp, 780 inline void scr_WriteMessage(const char *jid, const char *text,
781 guint prefix_flags) 781 time_t timestamp, guint prefix_flags)
782 { 782 {
783 if (!timestamp) timestamp = time(NULL); 783 if (!timestamp) timestamp = time(NULL);
784 784
785 scr_WriteInWindow(jid, text, timestamp, prefix_flags, FALSE); 785 scr_WriteInWindow(jid, text, timestamp, prefix_flags, FALSE);
786 } 786 }
912 // scr_RosterSearch(str) 912 // scr_RosterSearch(str)
913 // Look forward for a buddy with jid/name containing str. 913 // Look forward for a buddy with jid/name containing str.
914 void scr_RosterSearch(char *str) 914 void scr_RosterSearch(char *str)
915 { 915 {
916 set_current_buddy(buddy_search(str)); 916 set_current_buddy(buddy_search(str));
917 if (chatmode)
918 scr_ShowBuddyWindow();
919 }
920
921 // scr_RosterJumpJid(jid)
922 // Jump to buddy jid.
923 // NOTE: With this function, the buddy is added to the roster if doesn't exist.
924 void scr_RosterJumpJid(char *barejid)
925 {
926 GSList *roster_elt;
927 // Look for an existing buddy
928 roster_elt = roster_find(barejid, jidsearch,
929 ROSTER_TYPE_USER|ROSTER_TYPE_AGENT|ROSTER_TYPE_ROOM);
930 // Create it if necessary
931 if (!roster_elt)
932 roster_elt = roster_add_user(barejid, NULL, NULL, ROSTER_TYPE_USER);
933 // Set a lock to see it in the buddylist
934 buddy_setflags(BUDDATA(roster_elt), ROSTER_FLAG_LOCK, TRUE);
935 buddylist_build();
936 // Jump to the buddy
937 set_current_buddy(buddy_search_jid(barejid));
917 if (chatmode) 938 if (chatmode)
918 scr_ShowBuddyWindow(); 939 scr_ShowBuddyWindow();
919 } 940 }
920 941
921 // scr_RosterUnreadMessage(next) 942 // scr_RosterUnreadMessage(next)