+ wcsession *WCC = WC;
+ HashList *Domains;
+ StrBuf *Line;
+ StrBuf *Token;
+ StrBuf *RoomName;
+ HashList *PossibleAliases = NULL;
+
+ const char *pComma;
+ const char *pAt;
+ long aliaslen;
+ long locallen;
+ long State;
+ long n = 0;
+
+ Domains = GetValidDomainNames(Target, TP);
+ if (Domains == NULL)
+ return NULL;
+ if (GetCount(Domains) == 0) {
+ DeleteHash(&Domains);
+ return NULL;
+ }
+ PossibleAliases = NewHash(1, NULL);
+ Line = NewStrBuf();
+ RoomName = NewStrBufDup(WCC->CurRoom.name);
+ StrBufAsciify(RoomName, '_');
+ StrBufReplaceChars(RoomName, ' ', '_');
+
+ AppendPossibleAliasWithDomain(PossibleAliases,
+ &n,
+ Domains,
+ HKEY("room_"),
+ SKEY(RoomName));
+
+
+ serv_puts("GNET "FILE_MAILALIAS);
+ StrBuf_ServGetln(Line);
+ if (GetServerStatus(Line, &State) == 1)
+ {
+ int Done = 0;
+
+ while(!Done && (StrBuf_ServGetln(Line) >= 0))
+ if ( (StrLength(Line)==3) &&
+ !strcmp(ChrPtr(Line), "000"))
+ {
+ Done = 1;
+ }
+ else
+ {
+ pComma = strchr(ChrPtr(Line), ',');
+ if (pComma == NULL)
+ continue;
+ aliaslen = pComma - ChrPtr(Line);
+ locallen = StrLength(Line) - 1 - aliaslen;
+ if (locallen - 5 != StrLength(WCC->CurRoom.name))
+ continue;
+ if (strncmp(pComma + 1, "room_", 5) != 0)
+ continue;
+
+ if (strcasecmp(pComma + 6, ChrPtr(WCC->CurRoom.name)) != 0)
+ continue;
+ pAt = strchr(ChrPtr(Line), '@');
+ if ((pAt == NULL) || (pAt > pComma))
+ {
+ AppendPossibleAliasWithDomain(PossibleAliases,
+ &n,
+ Domains,
+ HKEY(""),
+ ChrPtr(Line),
+ aliaslen);
+ n++;
+ }
+ else
+ {
+
+ Token = NewStrBufPlain(ChrPtr(Line), aliaslen);
+ Put(PossibleAliases,
+ IKEY(n),
+ Token,
+ HFreeStrBuf);
+ n++;
+ }
+ }
+ }
+ else if (State == 550)
+ AppendImportantMessage(_("Higher access is required to access this function."), -1);
+ DeleteHash(&Domains);
+ FreeStrBuf(&Line);
+ FreeStrBuf(&RoomName);
+ return PossibleAliases;