Mercurial > ~mikael > mcabber > hg
comparison mcabber/mcabber/roster.c @ 1727:15e6b21df606
Add helper function roster_getprio()
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Sun, 28 Feb 2010 14:09:47 +0100 |
parents | b2e0083891cc |
children | e6e89b1d7831 |
comparison
equal
deleted
inserted
replaced
1726:98917ddcbaab | 1727:15e6b21df606 |
---|---|
756 if (p_res) | 756 if (p_res) |
757 return p_res->status_msg; | 757 return p_res->status_msg; |
758 return roster_usr->offline_status_message; | 758 return roster_usr->offline_status_message; |
759 } | 759 } |
760 | 760 |
761 char roster_getprio(const char *jid, const char *resname) | |
762 { | |
763 GSList *sl_user; | |
764 roster *roster_usr; | |
765 res *p_res; | |
766 | |
767 sl_user = roster_find(jid, jidsearch, ROSTER_TYPE_USER|ROSTER_TYPE_AGENT); | |
768 if (sl_user == NULL) | |
769 return offline; // Not in the roster, anyway... | |
770 | |
771 roster_usr = (roster*)sl_user->data; | |
772 p_res = get_resource(roster_usr, resname); | |
773 if (p_res) | |
774 return p_res->prio; | |
775 return 0; | |
776 } | |
777 | |
761 guint roster_gettype(const char *jid) | 778 guint roster_gettype(const char *jid) |
762 { | 779 { |
763 GSList *sl_user; | 780 GSList *sl_user; |
764 roster *roster_usr; | 781 roster *roster_usr; |
765 | 782 |