Index: Branch_1-20-Viewer/indra/newview/llmutelist.cpp =================================================================== --- Branch_1-20-Viewer.orig/indra/newview/llmutelist.cpp 2008-05-17 00:28:05.000000000 +0200 +++ Branch_1-20-Viewer/indra/newview/llmutelist.cpp 2008-05-17 00:29:28.000000000 +0200 @@ -443,40 +443,46 @@ gAgent.sendReliableMessage(); } -void notify_automute_callback(const LLUUID& agent_id, const char* first_name, const char* last_name, BOOL is_group, void* user_data) +void notify_automute_callback(const LLUUID& agent_id, const char* first_name, const char* last_name, BOOL is_group, void *user_data) { - U32 temp_data = (U32)user_data; - LLMuteList::EAutoReason reason = (LLMuteList::EAutoReason)temp_data; - LLUIString auto_message; + if (user_data) + { + U32 *preason = (U32*)user_data; + U32 temp_data = *preason; + delete preason; + + LLMuteList::EAutoReason reason = (LLMuteList::EAutoReason)temp_data; + LLUIString auto_message; - switch (reason) - { - default: - case LLMuteList::AR_IM: - auto_message = LLNotifyBox::getTemplateMessage("AutoUnmuteByIM"); - break; - case LLMuteList::AR_INVENTORY: - auto_message = LLNotifyBox::getTemplateMessage("AutoUnmuteByInventory"); - break; - case LLMuteList::AR_MONEY: - auto_message = LLNotifyBox::getTemplateMessage("AutoUnmuteByMoney"); - break; - } + switch (reason) + { + default: + case LLMuteList::AR_IM: + auto_message = LLNotifyBox::getTemplateMessage("AutoUnmuteByIM"); + break; + case LLMuteList::AR_INVENTORY: + auto_message = LLNotifyBox::getTemplateMessage("AutoUnmuteByInventory"); + break; + case LLMuteList::AR_MONEY: + auto_message = LLNotifyBox::getTemplateMessage("AutoUnmuteByMoney"); + break; + } - auto_message.setArg("[FIRST]", first_name); - auto_message.setArg("[LAST]", last_name); + auto_message.setArg("[FIRST]", first_name); + auto_message.setArg("[LAST]", last_name); - if (reason == LLMuteList::AR_IM) - { - LLFloaterIMPanel *timp = gIMMgr->findFloaterBySession(agent_id); - if (timp) + if (reason == LLMuteList::AR_IM) { - timp->addHistoryLine(auto_message.getString()); + LLFloaterIMPanel *timp = gIMMgr->findFloaterBySession(agent_id); + if (timp) + { + timp->addHistoryLine(auto_message.getString()); + } } - } - LLChat auto_chat(auto_message.getString()); - LLFloaterChat::addChat(auto_chat, FALSE, FALSE); + LLChat auto_chat(auto_message.getString()); + LLFloaterChat::addChat(auto_chat, FALSE, FALSE); + } } @@ -490,6 +496,8 @@ removed = TRUE; remove(automute); + U32 *preason = new U32(reason); + if (first_name.empty() && last_name.empty()) { char cache_first[DB_FIRST_NAME_BUF_SIZE]; /* Flawfinder: ignore */ @@ -497,18 +505,18 @@ if (gCacheName->getName(agent_id, cache_first, cache_last)) { // name in cache, call callback directly - notify_automute_callback(agent_id, cache_first, cache_last, FALSE, (void *)reason); + notify_automute_callback(agent_id, cache_first, cache_last, FALSE, preason); } else { // not in cache, lookup name from cache - gCacheName->get(agent_id, FALSE, notify_automute_callback, (void *)reason); + gCacheName->get(agent_id, FALSE, notify_automute_callback, preason); } } else { // call callback directly - notify_automute_callback(agent_id, first_name.c_str(), last_name.c_str(), FALSE, (void *)reason); + notify_automute_callback(agent_id, first_name.c_str(), last_name.c_str(), FALSE, preason); } }