SDU
Personal tools

Cnt.get members to notify by persid

From SDU

Jump to: navigation, search
To make corrections or additions to this article, select the edit tab above.
To discuss or ask questions about this article, select the discussion tab above.

Overview

This method gets a list of members with Notify flag set ON for specified group .

This action can be called in spell code in method send_wait (or send) using call_attr action.

Usage

void send_wait (int timeout, object top_object, "call_attr", "cnt", "get_members_to_notify_by_persid", contact_persid)
  • timeout - how long (in seconds) should the method wait for finishing the method (0 means infinite [no timeout] and is generally the value used)
  • top_object - root object for the method (on which the method is called)
  • contact_persid - persistent ID of a group for which members you are looking for

Results

success or failure is tested with msg_error() (boolean function)

On success the resulted list is filled into a global array msg as follows:

  • msg[0] - the number of assigned groups
  • msg[1] - one string with a list of member persistent IDs separated by spaces (" ")

On failure

  • msg[0] - failure reason

Examples

int i;
send_wait(0, top_object(), "call_attr", "cnt", "get_members_to_notify_by_persid", "cnt:776B094702EABB4B87F04A139E72D44B");
if( msg_error()) {
    logf (ERROR, "failure in send_wait ..... .Reason: %s",msg[0]);
} else {
    string member_persids[msg[0]];
    split(member_persids, msg[1], " ");
    for (i=0;i<msg[0];i++) {
        logf (SIGNIFICANT, "Notify %s", member_persids[i]);
    }
}
string notify_list;
send_wait(0, top_object(), "call_attr", "cnt", "get_members_to_notify_by_persid", msg_target);
if (msg_error()) {
    logf(ERROR, "%s: Error in get_members_to_notify_by_persid(%s)", method, msg_target);
    return 1;
} else {
    notify_list = msg[1] + " " + msg_target;
}
 
logf(TRACE, "%s: Going to notify these users: %s", method, notify_list);
send_wait(0, top_object(), "call_attr", "cnt", "notify_list", notify_list, msg_level, msg_title, msg_body, "" /* msg_ack */, 
          tran_pt, ticket, is_internal, 0 /* cmth_override */);
This page was last modified 14:35, 19 July 2011.  This page has been accessed 424 times.  Content is available under Attribution-Noncommercial-Share Alike 3.0 UnportedDisclaimers