UI data is stored on GObjects and automatically destroyed, so this isn't
really needed as a UI op for *our* UIs. There will be a replacement soon
if needed by other UIs.
/*
* nmevent.c
*
* Copyright (c) 2004 Novell, Inc. All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*
*/
#include<glib.h>
#include<string.h>
#include<time.h>
#include"nmevent.h"
#include"nmfield.h"
#include"nmconn.h"
#include"nmuserrecord.h"
#include"nmrtf.h"
#define MAX_UINT32 0xFFFFFFFF
struct_NMEvent
{
/* Event type */
inttype;
/* The DN of the event source */
char*source;
/* Timestamp of the event */
guint32gmt;
/* Conference to associate with the event */
NMConference*conference;
/* User record to associate with the event */
NMUserRecord*user_record;
/* Text associated with the event */
char*text;
/* Reference count for event structure */
intref_count;
};
/* Handle getdetails response and set the new user record into the event */
staticvoid
_got_user_for_event(NMUser*user,NMERR_Tret_val,
gpointerresp_data,gpointeruser_data)
{
NMUserRecord*user_record;
NMEvent*event;
nm_event_cbcb;
if(user==NULL)
return;
user_record=resp_data;
event=user_data;
if(ret_val==NM_OK){
if(event&&user_record){
/* Add the user record to the event structure
* and make the callback.
*/
nm_event_set_user_record(event,user_record);
if((cb=nm_user_get_event_callback(user))){
cb(user,event);
}
}
}else{
/* Cleanup resp_data */
}
/* Clean up */
if(event)
nm_release_event(event);
}
/* Handle getdetails response, set the new user record into the event
* and add the user record as a participant in the conference