This add a static inline version of `g_memdup2` if the version of glib we're
compiling against doesn't have the function.
GHSL-2021-045 was originally reported to glib at
https://gitlab.gnome.org/GNOME/glib/-/issues/2319.
More information about the entire situation can be found on the gnome
desktop-devel-list at
https://mail.gnome.org/archives/desktop-devel-list/2021-February/msg00000.html
Testing Done:
Compiled and ran tests locally.
Reviewed at https://reviews.imfreedom.org/r/483/
/*
* Purple's oscar protocol plugin
* This file is the legal property of its developers.
* Please see the AUTHORS file distributed alongside this file.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*/
/*
* Displaying various information about buddies.
*/
#include"encoding.h"
#include"oscar.h"
staticgchar*
oscar_caps_to_string(guint64caps)
{
GString*str;
constgchar*tmp;
guint64bit=1;
str=g_string_new("");
if(!caps){
returnNULL;
}elsewhile(bit<=OSCAR_CAPABILITY_LAST){
if(bit&caps){
switch(bit){
caseOSCAR_CAPABILITY_BUDDYICON:
tmp=_("Buddy Icon");
break;
caseOSCAR_CAPABILITY_TALK:
tmp=_("Voice");
break;
caseOSCAR_CAPABILITY_DIRECTIM:
tmp=_("AIM Direct IM");
break;
caseOSCAR_CAPABILITY_CHAT:
tmp=_("Chat");
break;
caseOSCAR_CAPABILITY_GETFILE:
tmp=_("Get File");
break;
caseOSCAR_CAPABILITY_SENDFILE:
tmp=_("Send File");
break;
caseOSCAR_CAPABILITY_GAMES:
caseOSCAR_CAPABILITY_GAMES2:
tmp=_("Games");
break;
caseOSCAR_CAPABILITY_XTRAZ:
caseOSCAR_CAPABILITY_NEWCAPS:
tmp=_("ICQ Xtraz");
break;
caseOSCAR_CAPABILITY_ADDINS:
tmp=_("Add-Ins");
break;
caseOSCAR_CAPABILITY_SENDBUDDYLIST:
tmp=_("Send Buddy List");
break;
caseOSCAR_CAPABILITY_ICQ_DIRECT:
tmp=_("ICQ Direct Connect");
break;
caseOSCAR_CAPABILITY_APINFO:
tmp=_("AP User");
break;
caseOSCAR_CAPABILITY_ICQRTF:
tmp=_("ICQ RTF");
break;
caseOSCAR_CAPABILITY_EMPTY:
tmp=_("Nihilist");
break;
caseOSCAR_CAPABILITY_ICQSERVERRELAY:
tmp=_("ICQ Server Relay");
break;
caseOSCAR_CAPABILITY_UNICODEOLD:
tmp=_("Old ICQ UTF8");
break;
caseOSCAR_CAPABILITY_TRILLIANCRYPT:
tmp=_("Trillian Encryption");
break;
caseOSCAR_CAPABILITY_UNICODE:
tmp=_("ICQ UTF8");
break;
caseOSCAR_CAPABILITY_HIPTOP:
tmp=_("Hiptop");
break;
caseOSCAR_CAPABILITY_SECUREIM:
tmp=_("Security Enabled");
break;
caseOSCAR_CAPABILITY_VIDEO:
tmp=_("Video Chat");
break;
/* Not actually sure about this one... WinAIM doesn't show anything */
* @brief Append the status information to a user_info struct
*
* The returned information is HTML-ready, appropriately escaped, as all information in a user_info struct should be HTML.
*
* @param gc The PurpleConnection
* @param user_info A PurpleNotifyUserInfo object to which status information will be added
* @param b The PurpleBuddy whose status is desired. This or the aim_userinfo_t (or both) must be passed to oscar_user_info_append_status().
* @param userinfo The aim_userinfo_t of the buddy whose status is desired. This or the PurpleBuddy (or both) must be passed to oscar_user_info_append_status().
* @param use_html_status If TRUE, prefer HTML-formatted away message over plaintext available message.